summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-06-07 02:29:03 (GMT)
committerGreg Ward <gward@python.net>2000-06-07 02:29:03 (GMT)
commit1169687692e5e897033421fe6a73a3c32675a7d7 (patch)
tree256b6e5655538cd873d44ab6fd05a7631dc475fd
parentacf3f6a7000eaed43f8c4e5df249967b06dfc474 (diff)
downloadcpython-1169687692e5e897033421fe6a73a3c32675a7d7.zip
cpython-1169687692e5e897033421fe6a73a3c32675a7d7.tar.gz
cpython-1169687692e5e897033421fe6a73a3c32675a7d7.tar.bz2
Always look for the system config file in the Distutils module directory,
and call it "distutils.cfg" instead of "pydistutils.cfg" (personal config files are still ".pydistutils.cfg" or "pydistutils.cfg", though).
-rw-r--r--Lib/distutils/dist.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/Lib/distutils/dist.py b/Lib/distutils/dist.py
index ea4ec2e..0b8a99e 100644
--- a/Lib/distutils/dist.py
+++ b/Lib/distutils/dist.py
@@ -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)