diff --git a/Lib/distutils/command/install_scripts.py b/Lib/distutils/command/install_scripts.py index 3bc23e7460f..d4cbaa3a0a8 100644 --- a/Lib/distutils/command/install_scripts.py +++ b/Lib/distutils/command/install_scripts.py @@ -50,7 +50,7 @@ class install_scripts (Command): if self.dry_run: self.announce("changing mode of %s" % file) else: - mode = (os.stat(file)[ST_MODE]) | 0111 + mode = ((os.stat(file)[ST_MODE]) | 0111) & 07777 self.announce("changing mode of %s to %o" % (file, mode)) os.chmod(file, mode)