Patchwork [4,of,7] readlink: use print_function

login
register
mail settings
Submitter timeless
Date May 11, 2016, 5:20 a.m.
Message ID <3572b4c6d058583392f1.1462944026@gcc2-power8.osuosl.org>
Download mbox | patch
Permalink /patch/14995/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

timeless - May 11, 2016, 5:20 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1462931819 0
#      Wed May 11 01:56:59 2016 +0000
# Node ID 3572b4c6d058583392f19d3c397804bc37e98a7b
# Parent  9f0c4cf04ef4f87f102ddd1a0cadf99aad288f06
# EXP-Topic runtests
# Available At bb://timeless/mercurial-crew
#              hg pull bb://timeless/mercurial-crew -r 3572b4c6d058
readlink: use print_function

Patch

diff -r 9f0c4cf04ef4 -r 3572b4c6d058 tests/readlink.py
--- a/tests/readlink.py	Fri May 06 01:15:07 2016 +0000
+++ b/tests/readlink.py	Wed May 11 01:56:59 2016 +0000
@@ -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 -r 9f0c4cf04ef4 -r 3572b4c6d058 tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t	Fri May 06 01:15:07 2016 +0000
+++ b/tests/test-check-py3-compat.t	Wed May 11 01:56:59 2016 +0000
@@ -29,7 +29,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
@@ -163,6 +162,5 @@ 
   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/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
 
 #endif