crecord: stop raising error.Abort if curses is not found (issue5008) stable
authorSean Farley <sean@farley.io>
Wed, 16 Dec 2015 10:39:00 -0800
branchstable
changeset 27532 1be02894dd6f
parent 27531 84d686cb62c4
child 27533 a801d331a022
child 27555 ca8ada499529
crecord: stop raising error.Abort if curses is not found (issue5008) On some servers, python curses support is disabled. This patch not only fixes that but provides a fallback on other machines (e.g. Windows) when curses is not found. The previous code was actually flawed logic and relied on wcurses throwing an ImportError which demandimport wouldn't throw. So, this patch also fixes that problem.
mercurial/crecord.py
--- a/mercurial/crecord.py	Tue Dec 15 16:01:45 2015 -0800
+++ b/mercurial/crecord.py	Wed Dec 16 10:39:00 2015 -0800
@@ -47,13 +47,6 @@
         # compiled with curses
         curses = False
 
-try:
-    curses
-except NameError:
-    if os.name != 'nt':  # Temporary hack to get running on Windows again
-        raise error.Abort(
-            _('the python curses/wcurses module is not available/installed'))
-
 def checkcurses(ui):
     """Return True if the user wants to use curses