# HG changeset patch # User Augie Fackler # Date 2015-04-12 19:36:10 # Node ID 9c1942635c1febc80342bf2c52aad63f1238f32c # Parent 6b54f749659b2cd9a6c18d0e020c48ae837ba42d setup: hide octal literals inside strings so they're portable (issue4554) diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -408,11 +408,12 @@ class hginstalllib(install_lib): # 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)