diff --git a/mercurial/color.py b/mercurial/color.py --- a/mercurial/color.py +++ b/mercurial/color.py @@ -44,7 +44,7 @@ b'cyan': (False, curses.COLOR_CYAN, b''), b'white': (False, curses.COLOR_WHITE, b''), } -except ImportError: +except (ImportError, AttributeError): curses = None _baseterminfoparams = {} diff --git a/mercurial/crecord.py b/mercurial/crecord.py --- a/mercurial/crecord.py +++ b/mercurial/crecord.py @@ -63,13 +63,13 @@ import curses.ascii curses.error -except ImportError: +except (ImportError, AttributeError): # I have no idea if wcurses works with crecord... try: import wcurses as curses curses.error - except ImportError: + except (ImportError, AttributeError): # wcurses is not shipped on Windows by default, or python is not # compiled with curses curses = False diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -685,7 +685,7 @@ curses.COLOR_BLUE return matchoutput('test -x "`which tic`"', br'') - except ImportError: + except (ImportError, AttributeError): return False