Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/scmposix.py @ 31348:7c09b071318a
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.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 12 Mar 2017 22:27:53 +0530 |
parents | 354020079723 |
children | bf5e13e38390 |
comparison
equal
deleted
inserted
replaced
31347:a9a28ca17615 | 31348:7c09b071318a |
---|---|
64 except AttributeError: | 64 except AttributeError: |
65 continue | 65 continue |
66 if not os.isatty(fd): | 66 if not os.isatty(fd): |
67 continue | 67 continue |
68 arri = fcntl.ioctl(fd, TIOCGWINSZ, '\0' * 8) | 68 arri = fcntl.ioctl(fd, TIOCGWINSZ, '\0' * 8) |
69 height, width = array.array('h', arri)[:2] | 69 height, width = array.array(r'h', arri)[:2] |
70 if width > 0 and height > 0: | 70 if width > 0 and height > 0: |
71 return width, height | 71 return width, height |
72 except ValueError: | 72 except ValueError: |
73 pass | 73 pass |
74 except IOError as e: | 74 except IOError as e: |