changeset 28724:cf339d6ac7c7

py3: use print_function in filterpyflakes.py
author Robert Stanca <robert.stanca7@gmail.com>
date Sat, 02 Apr 2016 17:35:02 +0300
parents 18e738038d78
children 3cf1995dbdd5
files tests/filterpyflakes.py tests/test-check-py3-compat.t
diffstat 2 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/tests/filterpyflakes.py	Sat Apr 02 17:33:11 2016 +0300
+++ b/tests/filterpyflakes.py	Sat Apr 02 17:35:02 2016 +0300
@@ -2,7 +2,7 @@
 
 # Filter output by pyflakes to control which warnings we check
 
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function
 
 import re
 import sys
@@ -54,8 +54,8 @@
 
 for msgtype, line in sorted(lines, key=makekey):
     sys.stdout.write(line)
-print
+print()
 
 # self test of "undefined name" detection for other than 'memoryview'
 if False:
-    print undefinedname
+    print(undefinedname)
--- a/tests/test-check-py3-compat.t	Sat Apr 02 17:33:11 2016 +0300
+++ b/tests/test-check-py3-compat.t	Sat Apr 02 17:35:02 2016 +0300
@@ -40,7 +40,6 @@
   i18n/check-translation.py not using absolute_import
   i18n/polib.py not using absolute_import
   setup.py not using absolute_import
-  tests/filterpyflakes.py requires print_function
   tests/generate-working-copy-states.py requires print_function
   tests/get-with-headers.py requires print_function
   tests/heredoctest.py requires print_function
@@ -259,7 +258,6 @@
   mercurial/win*.py: error importing module: <ImportError> No module named 'msvcrt' (line *) (glob)
   mercurial/windows.py: error importing module: <ImportError> No module named '_winreg' (line *) (glob)
   mercurial/wireproto.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob)
-  tests/filterpyflakes.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
   tests/generate-working-copy-states.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
   tests/get-with-headers.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
   tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)