Patchwork [07,of,10] tests: update test-inherit-mode to pass our import checker

login
register
mail settings
Submitter Augie Fackler
Date Aug. 28, 2017, 3:27 p.m.
Message ID <d3b8378b515f1986bea3.1503934055@augie-macbookpro2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/23428/
State Accepted
Headers show

Comments

Augie Fackler - Aug. 28, 2017, 3:27 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1503436509 14400
#      Tue Aug 22 17:15:09 2017 -0400
# Node ID d3b8378b515f1986bea3bf1244383b3f6393781e
# Parent  8f378e7db536977a5626db61b677f9d3171c82e6
tests: update test-inherit-mode to pass our import checker

Patch

diff --git a/tests/test-inherit-mode.t b/tests/test-inherit-mode.t
--- a/tests/test-inherit-mode.t
+++ b/tests/test-inherit-mode.t
@@ -10,7 +10,9 @@  just in case somebody has a strange $TMP
   $ cd dir
 
   $ cat >printmodes.py <<EOF
-  > import os, sys
+  > from __future__ import absolute_import, print_function
+  > import os
+  > import sys
   > 
   > allnames = []
   > isdir = {}
@@ -25,12 +27,13 @@  just in case somebody has a strange $TMP
   > allnames.sort()
   > for name in allnames:
   >     suffix = name in isdir and '/' or ''
-  >     print('%05o %s%s' % (os.lstat(name).st_mode & 07777, name, suffix))
+  >     print('%05o %s%s' % (os.lstat(name).st_mode & 0o7777, name, suffix))
   > EOF
 
   $ cat >mode.py <<EOF
+  > from __future__ import absolute_import, print_function
+  > import os
   > import sys
-  > import os
   > print('%05o' % os.lstat(sys.argv[1]).st_mode)
   > EOF