]> granicus.if.org Git - python/commitdiff
Always look for the system config file in the Distutils module directory,
authorGreg Ward <gward@python.net>
Wed, 7 Jun 2000 02:29:03 +0000 (02:29 +0000)
committerGreg Ward <gward@python.net>
Wed, 7 Jun 2000 02:29:03 +0000 (02:29 +0000)
and call it "distutils.cfg" instead of "pydistutils.cfg" (personal
config files are still ".pydistutils.cfg" or "pydistutils.cfg", though).

Lib/distutils/dist.py

index ea4ec2e7e9a09cca49891029a2f8742d79904b7d..0b8a99e1cde90448f7bd58eb7509afce930da362 100644 (file)
@@ -265,20 +265,23 @@ class Distribution:
         files = []
         check_environ()
 
-        if os.name=='posix':
-           sys_dir = os.path.dirname(sys.modules['distutils'].__file__)
+        # Where to look for the system-wide Distutils config file
+        sys_dir = os.path.dirname(sys.modules['distutils'].__file__)
+
+        # Look for the system config file
+        sys_file = os.path.join(sys_dir, "distutils.cfg")
+        if os.path.isfile(sys_file):
+            files.append(sys_file)
+
+        # What to call the per-user config file
+        if os.name == 'posix':
            user_filename = ".pydistutils.cfg"
        else:
-           sys_dir = sysconfig.PREFIX
            user_filename = "pydistutils.cfg"
        
-        sys_file = os.path.join(sys_dir, "pydistutils.cfg")
-        if os.path.isfile(sys_file):
-            files.append(sys_file)
-
+        # And look for the user config file
        if os.environ.has_key('HOME'):
-           user_file = os.path.join(os.environ.get('HOME'),
-                                     user_filename)
+           user_file = os.path.join(os.environ.get('HOME'), user_filename)
             if os.path.isfile(user_file):
                 files.append(user_file)