# HG changeset patch # User timeless # Date 2016-05-11 01:56:59 # Node ID 7bcfb9090c86d99b4eeb4e02cdda7ca3cb3373d9 # Parent 478e2b85fccec70d3232df0cbcbf1286ed141491 readlink: use print_function diff --git a/tests/readlink.py b/tests/readlink.py --- a/tests/readlink.py +++ b/tests/readlink.py @@ -1,13 +1,15 @@ #!/usr/bin/env python +from __future__ import print_function + import errno, os, sys for f in sys.argv[1:]: try: - print f, '->', os.readlink(f) + print(f, '->', os.readlink(f)) except OSError as err: if err.errno != errno.EINVAL: raise - print f, 'not a symlink' + print(f, '->', f, 'not a symlink') sys.exit(0) diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t --- a/tests/test-check-py3-compat.t +++ b/tests/test-check-py3-compat.t @@ -28,7 +28,6 @@ tests/heredoctest.py requires print_function tests/md5sum.py not using absolute_import tests/readlink.py not using absolute_import - tests/readlink.py requires print_function tests/run-tests.py not using absolute_import tests/svn-safe-append.py not using absolute_import tests/test-atomictempfile.py not using absolute_import @@ -161,6 +160,5 @@ mercurial/win*.py: error importing module: No module named 'msvcrt' (line *) (glob) mercurial/windows.py: error importing module: No module named '_winreg' (line *) (glob) mercurial/wireproto.py: error importing module: invalid syntax (bundle*.py, line *) (line *) (glob) - tests/readlink.py: invalid syntax: invalid syntax (, line *) (glob) #endif