]> arthur.barton.de Git - bup.git/commitdiff
root-status: use print_function
authorRob Browning <rlb@defaultvalue.org>
Wed, 15 Mar 2017 04:05:14 +0000 (23:05 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sat, 20 Jan 2018 19:20:38 +0000 (13:20 -0600)
Python 3 requires it.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
t/root-status

index 4f21599f83aaacb98c83b8ccbb1d0b9989d2d0fb..0c43e9d38b88f21e094b4c25f0cd700ece48758a 100755 (executable)
@@ -5,6 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
 """
 # end of bup preamble
 
+from __future__ import print_function
 from sys import stderr
 import sys
 
 from sys import stderr
 import sys
 
@@ -12,19 +13,20 @@ import sys
 if sys.platform.startswith('cygwin'):
     if sys.getwindowsversion()[0] > 5:
         # Sounds like the situation is much more complicated here
 if sys.platform.startswith('cygwin'):
     if sys.getwindowsversion()[0] > 5:
         # Sounds like the situation is much more complicated here
-        print >> stderr, "can't detect root status for OS version > 5; assuming not root"
-        print 'none'
+        print("can't detect root status for OS version > 5; assuming not root",
+              file=stderr)
+        print('none')
     import ctypes
     if ctypes.cdll.shell32.IsUserAnAdmin():
     import ctypes
     if ctypes.cdll.shell32.IsUserAnAdmin():
-        print 'root'
+        print('root')
     else:
     else:
-        print 'none'
+        print('none')
 else:
     import os
     if os.environ.get('FAKEROOTKEY'):
 else:
     import os
     if os.environ.get('FAKEROOTKEY'):
-        print 'fake'
+        print('fake')
     else:
         if os.geteuid() == 0:
     else:
         if os.geteuid() == 0:
-            print 'root'
+            print('root')
         else:
         else:
-            print 'none'
+            print('none')