##// END OF EJS Templates
py3: make test-demandimport use print_function...
Pulkit Goyal -
r28948:16390f4c default
parent child Browse files
Show More
@@ -48,7 +48,6 b''
48 tests/svn-safe-append.py not using absolute_import
48 tests/svn-safe-append.py not using absolute_import
49 tests/test-atomictempfile.py not using absolute_import
49 tests/test-atomictempfile.py not using absolute_import
50 tests/test-demandimport.py not using absolute_import
50 tests/test-demandimport.py not using absolute_import
51 tests/test-demandimport.py requires print_function
52
51
53 #if py3exe
52 #if py3exe
54 $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py
53 $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py
@@ -180,6 +179,5 b''
180 mercurial/windows.py: error importing module: <ImportError> No module named '_winreg' (line *) (glob)
179 mercurial/windows.py: error importing module: <ImportError> No module named '_winreg' (line *) (glob)
181 mercurial/wireproto.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob)
180 mercurial/wireproto.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob)
182 tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
181 tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
183 tests/test-demandimport.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
184
182
185 #endif
183 #endif
@@ -1,3 +1,5 b''
1 from __future__ import print_function
2
1 from mercurial import demandimport
3 from mercurial import demandimport
2 demandimport.enable()
4 demandimport.enable()
3
5
@@ -5,8 +7,8 b' import os'
5 if os.name != 'nt':
7 if os.name != 'nt':
6 try:
8 try:
7 import distutils.msvc9compiler
9 import distutils.msvc9compiler
8 print ('distutils.msvc9compiler needs to be an immediate '
10 print('distutils.msvc9compiler needs to be an immediate '
9 'importerror on non-windows platforms')
11 'importerror on non-windows platforms')
10 distutils.msvc9compiler
12 distutils.msvc9compiler
11 except ImportError:
13 except ImportError:
12 pass
14 pass
@@ -23,38 +25,38 b' def f(obj):'
23
25
24 import os
26 import os
25
27
26 print "os =", f(os)
28 print("os =", f(os))
27 print "os.system =", f(os.system)
29 print("os.system =", f(os.system))
28 print "os =", f(os)
30 print("os =", f(os))
29
31
30 from mercurial import util
32 from mercurial import util
31
33
32 print "util =", f(util)
34 print("util =", f(util))
33 print "util.system =", f(util.system)
35 print("util.system =", f(util.system))
34 print "util =", f(util)
36 print("util =", f(util))
35 print "util.system =", f(util.system)
37 print("util.system =", f(util.system))
36
38
37 from mercurial import hgweb
39 from mercurial import hgweb
38 print "hgweb =", f(hgweb)
40 print("hgweb =", f(hgweb))
39 print "hgweb_mod =", f(hgweb.hgweb_mod)
41 print("hgweb_mod =", f(hgweb.hgweb_mod))
40 print "hgweb =", f(hgweb)
42 print("hgweb =", f(hgweb))
41
43
42 import re as fred
44 import re as fred
43 print "fred =", f(fred)
45 print("fred =", f(fred))
44
46
45 import sys as re
47 import sys as re
46 print "re =", f(re)
48 print("re =", f(re))
47
49
48 print "fred =", f(fred)
50 print("fred =", f(fred))
49 print "fred.sub =", f(fred.sub)
51 print("fred.sub =", f(fred.sub))
50 print "fred =", f(fred)
52 print("fred =", f(fred))
51
53
52 print "re =", f(re)
54 print("re =", f(re))
53 print "re.stderr =", f(re.stderr)
55 print("re.stderr =", f(re.stderr))
54 print "re =", f(re)
56 print("re =", f(re))
55
57
56 demandimport.disable()
58 demandimport.disable()
57 os.environ['HGDEMANDIMPORT'] = 'disable'
59 os.environ['HGDEMANDIMPORT'] = 'disable'
58 demandimport.enable()
60 demandimport.enable()
59 from mercurial import node
61 from mercurial import node
60 print "node =", f(node)
62 print("node =", f(node))
General Comments 0
You need to be logged in to leave comments. Login now