chistedit: workaround a Python bug

Summary:
See http://bugs.python.org/issue27666 for details.

`win.box(0, 0)` will crash python if it is built with stack check / protection
(by using hardening-wrapper with `HARDENING_STACK_CHECK=1` and
`HARDENING_STACK_PROTECTOR=2`).

Test Plan: Run `hg chistedit tip` on Arch Linux, and it does not crash instantly.

Reviewers: #sourcecontrol, ttung, jeroenv

Reviewed By: jeroenv

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3806224

Signature: t1:3806224:1472758902:8a73645fd1ef98c9106c3b2766e368d4072a2d46
This commit is contained in:
Jun Wu 2016-09-01 20:18:36 +01:00
parent 9e1c1b0adf
commit 1b6413957a

View File

@ -348,7 +348,7 @@ def main(repo, rules, stdscr):
rule = rules[pos] rule = rules[pos]
ctx = rule.ctx ctx = rule.ctx
win.box(0, 0) win.box()
maxy, maxx = win.getmaxyx() maxy, maxx = win.getmaxyx()
length = maxx - 3 length = maxx - 3