changeset 24941:9c1942635c1f

setup: hide octal literals inside strings so they're portable (issue4554)
author Augie Fackler <augie@google.com>
date Sun, 12 Apr 2015 15:36:10 -0400
parents 6b54f749659b
children 8174d27576a3
files setup.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/setup.py	Wed Mar 26 15:55:50 2014 -0700
+++ b/setup.py	Sun Apr 12 15:36:10 2015 -0400
@@ -408,11 +408,12 @@
                 # Persist executable bit (apply it to group and other if user
                 # has it)
                 if st[stat.ST_MODE] & stat.S_IXUSR:
-                    setmode = 0755
+                    setmode = int('0755', 8)
                 else:
-                    setmode = 0644
-                os.chmod(dst, (stat.S_IMODE(st[stat.ST_MODE]) & ~0777) |
-                         setmode)
+                    setmode = int('0644', 8)
+                m = stat.S_IMODE(st[stat.ST_MODE])
+                m = (m & ~int('0777', 8)) | setmode
+                os.chmod(dst, m)
         file_util.copy_file = copyfileandsetmode
         try:
             install_lib.run(self)