diff options
author | Greg Ward <gward@python.net> | 2000-06-07 02:26:19 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 2000-06-07 02:26:19 (GMT) |
commit | acf3f6a7000eaed43f8c4e5df249967b06dfc474 (patch) | |
tree | 16a668d8b659336237b25ac34a30f9a961ed7461 /Lib | |
parent | 3f3ce04b1bef28fd9ed8ba751fad8460e5aa2ad8 (diff) | |
download | cpython-acf3f6a7000eaed43f8c4e5df249967b06dfc474.zip cpython-acf3f6a7000eaed43f8c4e5df249967b06dfc474.tar.gz cpython-acf3f6a7000eaed43f8c4e5df249967b06dfc474.tar.bz2 |
Patch from Rene Liebscher:
Look for personal config file in /home/greg on Windows, too: users will have
to set /home/greg to use this, so it's not something that many people will
use. But if python-dev comes up with the "right way" to divine a
home directory on Windows, we can use that to set /home/greg and poof! --
personal Distutils config files on Windows.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/distutils/dist.py | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/Lib/distutils/dist.py b/Lib/distutils/dist.py index 44f5c88..ea4ec2e 100644 --- a/Lib/distutils/dist.py +++ b/Lib/distutils/dist.py @@ -263,24 +263,25 @@ class Distribution: and setup.cfg in the current directory. """ files = [] - if os.name == "posix": - check_environ() - - sys_dir = os.path.dirname(sys.modules['distutils'].__file__) - sys_file = os.path.join(sys_dir, "pydistutils.cfg") - if os.path.isfile(sys_file): - files.append(sys_file) - - user_file = os.path.join(os.environ.get('HOME'), - ".pydistutils.cfg") + check_environ() + + if os.name=='posix': + sys_dir = os.path.dirname(sys.modules['distutils'].__file__) + 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) + + if os.environ.has_key('HOME'): + user_file = os.path.join(os.environ.get('HOME'), + user_filename) if os.path.isfile(user_file): files.append(user_file) - else: - sys_file = os.path.join (sysconfig.PREFIX, "pydistutils.cfg") - if os.path.isfile(sys_file): - files.append(sys_file) - # All platforms support local setup.cfg local_file = "setup.cfg" if os.path.isfile(local_file): |