##// END OF EJS Templates
py3: remove hack that removed flush argument from print() calls on Python 2
Manuel Jacob -
r50190:7d9a45c7 default
parent child Browse files
Show More
@@ -1,16 +1,4 b''
1 Test basic extension support
1 Test basic extension support
2 $ cat > unflush.py <<EOF
3 > import sys
4 > from mercurial import pycompat
5 > if pycompat.ispy3:
6 > # no changes required
7 > sys.exit(0)
8 > with open(sys.argv[1], 'rb') as f:
9 > data = f.read()
10 > with open(sys.argv[1], 'wb') as f:
11 > f.write(data.replace(b', flush=True', b''))
12 > EOF
13
14 $ cat > foobar.py <<EOF
2 $ cat > foobar.py <<EOF
15 > import os
3 > import os
16 > from mercurial import commands, exthelper, registrar
4 > from mercurial import commands, exthelper, registrar
@@ -189,7 +177,6 b' Check that extensions are loaded in phas'
189 > def custompredicate(repo, subset, x):
177 > def custompredicate(repo, subset, x):
190 > return smartset.baseset([r for r in subset if r in {0}])
178 > return smartset.baseset([r for r in subset if r in {0}])
191 > EOF
179 > EOF
192 $ "$PYTHON" $TESTTMP/unflush.py foo.py
193
180
194 $ cp foo.py bar.py
181 $ cp foo.py bar.py
195 $ echo 'foo = foo.py' >> $HGRCPATH
182 $ echo 'foo = foo.py' >> $HGRCPATH
@@ -302,7 +289,6 b' limit mark, regardless of importing modu'
302 > def extsetup(ui):
289 > def extsetup(ui):
303 > print('ambigabs.s=%s' % ambigabs.s, flush=True)
290 > print('ambigabs.s=%s' % ambigabs.s, flush=True)
304 > NO_CHECK_EOF
291 > NO_CHECK_EOF
305 $ "$PYTHON" $TESTTMP/unflush.py loadabs.py
306 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root)
292 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root)
307 ambigabs.s=libroot/ambig.py
293 ambigabs.s=libroot/ambig.py
308 $TESTTMP/a
294 $TESTTMP/a
@@ -1871,7 +1857,6 b' Prohibit the use of unicode strings as t'
1871 > def ext(*args, **opts):
1857 > def ext(*args, **opts):
1872 > print(opts[b'opt'], flush=True)
1858 > print(opts[b'opt'], flush=True)
1873 > EOF
1859 > EOF
1874 $ "$PYTHON" $TESTTMP/unflush.py $TESTTMP/test_unicode_default_value.py
1875 $ cat > $TESTTMP/opt-unicode-default/.hg/hgrc << EOF
1860 $ cat > $TESTTMP/opt-unicode-default/.hg/hgrc << EOF
1876 > [extensions]
1861 > [extensions]
1877 > test_unicode_default_value = $TESTTMP/test_unicode_default_value.py
1862 > test_unicode_default_value = $TESTTMP/test_unicode_default_value.py
General Comments 0
You need to be logged in to leave comments. Login now