Commits

Stefan H. Holek committed 2b8afec

os.access() cannot test for "createable" Fixes #320.

Comments (0)

Files changed (1)

distribute_setup.py

         log.warn('%s already exists', pkg_info)
         return
 
-    if not os.access(pkg_info, os.W_OK):
+    log.warn('Creating %s', pkg_info)
+    try:
+        f = open(pkg_info, 'w')
+    except EnvironmentError:
         log.warn("Don't have permissions to write %s, skipping", pkg_info)
         return
-
-    log.warn('Creating %s', pkg_info)
-    f = open(pkg_info, 'w')
     try:
         f.write(SETUPTOOLS_PKG_INFO)
     finally: