[PATCH 3 of 5 stable V2] crecord: ensure that curses is False if not imported

Sean Farley sean at farley.io
Wed Dec 16 12:46:25 CST 2015


# HG changeset patch
# User Sean Farley <sean at farley.io>
# Date 1450224006 28800
#      Tue Dec 15 16:00:06 2015 -0800
# Branch stable
# Node ID 11971d769204eb9b53bc37c75b569444bc5cd016
# Parent  35383e197db82c661b8db7be70297e96cab0839a
crecord: ensure that curses is False if not imported

This provides no functional change but makes the next two patches easier to
review.

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -41,12 +41,13 @@ except ImportError:
     # I have no idea if wcurses works with crecord...
     try:
         import wcurses as curses
         curses.error
     except ImportError:
-        # wcurses is not shipped on Windows by default
-        pass
+        # wcurses is not shipped on Windows by default, or python is not
+        # compiled with curses
+        curses = False
 
 try:
     curses
 except NameError:
     if os.name != 'nt':  # Temporary hack to get running on Windows again


More information about the Mercurial-devel mailing list