# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2017-03-12 16:57:53 # Node ID 7c09b071318a959c942de534cea5c6114ea954d8 # Parent a9a28ca17615c5d211422f56159552cacb4e15ef smcposix: pass unicode as first argument to array.array This is an instance where we can safely convert the first argument, rest are the cases except one where we are using 'c' which is not there in Python 3. So that needs to be handled differently. This will help in making `hg help` run on Python 3. diff --git a/mercurial/scmposix.py b/mercurial/scmposix.py --- a/mercurial/scmposix.py +++ b/mercurial/scmposix.py @@ -66,7 +66,7 @@ def termsize(ui): if not os.isatty(fd): continue arri = fcntl.ioctl(fd, TIOCGWINSZ, '\0' * 8) - height, width = array.array('h', arri)[:2] + height, width = array.array(r'h', arri)[:2] if width > 0 and height > 0: return width, height except ValueError: