summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2009-07-02 23:08:45 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2009-07-02 23:08:45 (GMT)
commit321e533c4c4cfc32ec6f1fb2c592f8c0e875d6c7 (patch)
treece9cf588dc428434f1fc0bc53e49a73d077fb3ac /setup.py
parentbceae0c1af7fd73ef3f71e0fbe2075b964accf55 (diff)
downloadcpython-321e533c4c4cfc32ec6f1fb2c592f8c0e875d6c7.zip
cpython-321e533c4c4cfc32ec6f1fb2c592f8c0e875d6c7.tar.gz
cpython-321e533c4c4cfc32ec6f1fb2c592f8c0e875d6c7.tar.bz2
#4601: 'make install' did not set the permissions on library directories,
only root could start IDLE for example. Beware that os.path.walk does not translate as is to os.walk! the former uses a callback to call on each dir, the latter is a generator...
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/setup.py b/setup.py
index 2738eec..c42416e 100644
--- a/setup.py
+++ b/setup.py
@@ -1605,12 +1605,11 @@ class PyBuildInstallLib(install_lib):
def set_dir_modes(self, dirname, mode):
if not self.is_chmod_supported(): return
- os.walk(dirname, self.set_dir_modes_visitor, mode)
-
- def set_dir_modes_visitor(self, mode, dirname, names):
- if os.path.islink(dirname): return
- log.info("changing mode of %s to %o", dirname, mode)
- if not self.dry_run: os.chmod(dirname, mode)
+ for dirpath, dirnames, fnames in os.walk(dirname):
+ if os.path.islink(dirpath):
+ continue
+ log.info("changing mode of %s to %o", dirpath, mode)
+ if not self.dry_run: os.chmod(dirpath, mode)
def is_chmod_supported(self):
return hasattr(os, 'chmod')