diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-03-26 16:45:52 +0200 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-03-26 16:45:52 +0200 |
commit | 8bc29e8aa88b13b4c64e8d83968c8c21320d5757 (patch) | |
tree | 3d48354c14549388dfe47e7c0fb94f31cf07e2f8 /pylint/test/functional/defined_and_used_on_same_line.py | |
parent | 65d557e7c1f5e7b224621b6c18aa930b891b8da4 (diff) | |
download | pylint-8bc29e8aa88b13b4c64e8d83968c8c21320d5757.tar.gz |
Try to make the tests compatible with both Python 2 and Python 3.
Diffstat (limited to 'pylint/test/functional/defined_and_used_on_same_line.py')
-rw-r--r-- | pylint/test/functional/defined_and_used_on_same_line.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/pylint/test/functional/defined_and_used_on_same_line.py b/pylint/test/functional/defined_and_used_on_same_line.py index fc19dc7..1d6bc99 100644 --- a/pylint/test/functional/defined_and_used_on_same_line.py +++ b/pylint/test/functional/defined_and_used_on_same_line.py @@ -1,8 +1,8 @@ """Check for definitions and usage happening on the same line.""" -#pylint: disable=missing-docstring,multiple-statements,print-statement,no-absolute-import,parameter-unpacking - -print [index - for index in range(10)] +#pylint: disable=missing-docstring,multiple-statements,no-absolute-import,parameter-unpacking +from __future__ import print_function +print([index + for index in range(10)]) print((index for index in range(10))) @@ -13,18 +13,17 @@ def func(xxx): return xxx def func2(xxx): return xxx + func2(1) -import sys; print sys.exc_info() +import sys; print(sys.exc_info()) -for i in range(10): print i +for i in range(10): print(i) j = 4; LAMB = lambda x: x+j FUNC4 = lambda a, b: a != b -FUNC3 = lambda (a, b): a != b # test http://www.logilab.org/ticket/6954: -with open('f') as f: print f.read() +with open('f') as f: print(f.read()) with open('f') as f, open(f.read()) as g: - print g.read() + print(g.read()) |