Mercurial > public > mercurial-scm > hg
comparison tests/test-status-inprocess.py @ 37901:bbff7170f665
tests: fix test-status-inprocess.py on Python 3
The same print() hack as test-filecache.py.
Differential Revision: https://phab.mercurial-scm.org/D3507
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 27 Apr 2018 11:23:41 -0400 |
parents | 9dfa4e9ed45d |
children | 7ce9dea3a14a |
comparison
equal
deleted
inserted
replaced
37900:b3ffa2faae04 | 37901:bbff7170f665 |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 from __future__ import absolute_import, print_function | 2 from __future__ import absolute_import, print_function |
3 | |
4 import sys | |
3 | 5 |
4 from mercurial import ( | 6 from mercurial import ( |
5 commands, | 7 commands, |
6 localrepo, | 8 localrepo, |
7 ui as uimod, | 9 ui as uimod, |
8 ) | 10 ) |
11 | |
12 print_ = print | |
13 def print(*args, **kwargs): | |
14 """print() wrapper that flushes stdout buffers to avoid py3 buffer issues | |
15 | |
16 We could also just write directly to sys.stdout.buffer the way the | |
17 ui object will, but this was easier for porting the test. | |
18 """ | |
19 print_(*args, **kwargs) | |
20 sys.stdout.flush() | |
9 | 21 |
10 u = uimod.ui.load() | 22 u = uimod.ui.load() |
11 | 23 |
12 print('% creating repo') | 24 print('% creating repo') |
13 repo = localrepo.localrepository(u, b'.', create=True) | 25 repo = localrepo.localrepository(u, b'.', create=True) |