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

login
register
mail settings
Submitter Sean Farley
Date Dec. 16, 2015, 6:46 p.m.
Message ID <11971d769204eb9b53bc.1450291585@laptop.office.atlassian.com>
Download mbox | patch
Permalink /patch/12075/
State Accepted
Headers show

Comments

Sean Farley - Dec. 16, 2015, 6:46 p.m.
# HG changeset patch
# User Sean Farley <sean@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.

Patch

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