tests: 'hghave tic' also requires curses support in Python stable
authorMads Kiilerich <madski@unity3d.com>
Mon, 20 Jan 2014 01:29:54 +0100
branchstable
changeset 1323 aeb658c7dbc7
parent 1321 79f68c0ed71e
child 1324 0af7748569a8
child 1325 8caca8a82e37
tests: 'hghave tic' also requires curses support in Python test-status-color.t would fail when using a Python without curses. [ original upstream message ]
tests/hghave.py
--- a/tests/hghave.py	Thu Jan 16 12:08:57 2014 +0100
+++ b/tests/hghave.py	Mon Jan 20 01:29:54 2014 +0100
@@ -272,7 +272,12 @@
     return os.name != 'nt' # gross approximation
 
 def has_tic():
-    return matchoutput('test -x "`which tic`"', '')
+    try:
+        import curses
+        curses.COLOR_BLUE
+        return matchoutput('test -x "`which tic`"', '')
+    except ImportError:
+        return False
 
 def has_msys():
     return os.getenv('MSYSTEM')
@@ -324,7 +329,7 @@
     "svn-bindings": (has_svn_bindings, "subversion python bindings"),
     "symlink": (has_symlink, "symbolic links"),
     "system-sh": (has_system_sh, "system() uses sh"),
-    "tic": (has_tic, "terminfo compiler"),
+    "tic": (has_tic, "terminfo compiler and curses module"),
     "tla": (has_tla, "GNU Arch tla client"),
     "unix-permissions": (has_unix_permissions, "unix-style permissions"),
     "windows": (has_windows, "Windows"),