diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -1221,6 +1221,11 @@ def termwidth(): return array.array('h', arri)[1] except ValueError: pass + except IOError, e: + if e[0] == errno.EINVAL: + pass + else: + raise except ImportError: pass return 80