From patchwork Wed Dec 16 00:06:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3,of,5,stable] crecord: ensure that curses is False if not imported From: Sean Farley X-Patchwork-Id: 12062 Message-Id: To: mercurial-devel@selenic.com Date: Tue, 15 Dec 2015 16:06:14 -0800 # HG changeset patch # User Sean Farley # Date 1450224006 28800 # Tue Dec 15 16:00:06 2015 -0800 # Branch stable # Node ID bd8254a6cc25a040fc70d10a7e1d06935865280f # Parent eb3ae2a5d034e0b4598bdb824e8584c983998820 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 @@ -37,16 +37,19 @@ try: except ImportError: # I have no idea if wcurses works with crecord... try: import wcurses as curses 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 +# On windows, curses can throw a NameError, so check for that here try: curses except NameError: + curses = False 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):