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.
This commit is contained in:
Greg Ward 2000-06-07 02:26:19 +00:00
parent 3f3ce04b1b
commit acf3f6a700
1 changed files with 14 additions and 13 deletions

View File

@ -263,24 +263,25 @@ class Distribution:
and setup.cfg in the current directory. and setup.cfg in the current directory.
""" """
files = [] files = []
if os.name == "posix": check_environ()
check_environ()
sys_dir = os.path.dirname(sys.modules['distutils'].__file__) if os.name=='posix':
sys_file = os.path.join(sys_dir, "pydistutils.cfg") sys_dir = os.path.dirname(sys.modules['distutils'].__file__)
if os.path.isfile(sys_file): user_filename = ".pydistutils.cfg"
files.append(sys_file) 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)
user_file = os.path.join(os.environ.get('HOME'), if os.environ.has_key('HOME'):
".pydistutils.cfg") user_file = os.path.join(os.environ.get('HOME'),
user_filename)
if os.path.isfile(user_file): if os.path.isfile(user_file):
files.append(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 # All platforms support local setup.cfg
local_file = "setup.cfg" local_file = "setup.cfg"
if os.path.isfile(local_file): if os.path.isfile(local_file):