setup: put back configuration of the PYTHONPATH which is necessary to build the Windows packages

This commit is contained in:
Zooko O'Whielacronx 2009-01-14 20:37:51 -07:00
parent 26ca53fa3d
commit 7fc784fc55

View File

@ -191,7 +191,7 @@ class ShowPythonPath(Command):
def run(self): def run(self):
# TODO: --quiet suppresses the 'running show_supportlib' message. # TODO: --quiet suppresses the 'running show_supportlib' message.
# Find a way to do this all the time. # Find a way to do this all the time.
print "PYTHONPATH=%s" % os.environ["PYTHONPATH"] print "PYTHONPATH=%s" % os.environ.get("PYTHONPATH", '')
class RunWithPythonPath(Command): class RunWithPythonPath(Command):
description = "Run a subcommand with PYTHONPATH set appropriately" description = "Run a subcommand with PYTHONPATH set appropriately"
@ -210,10 +210,16 @@ class RunWithPythonPath(Command):
def finalize_options(self): def finalize_options(self):
pass pass
def run(self): def run(self):
# os.environ['PYTHONPATH'] is already set by add_tahoe_paths, so we oldpp = os.environ.get("PYTHONPATH", "").split(os.pathsep)
# just need to exec() their command. We must require the command to if oldpp == [""]:
# be safe to split on whitespace, and have --python and --directory # grr silly split() behavior
# to make it easier to achieve this. oldpp = []
os.environ['PYTHONPATH'] = os.pathsep.join(oldpp + [supportlib,])
# We must require the command to be safe to split on
# whitespace, and have --python and --directory to make it
# easier to achieve this.
command = [] command = []
if self.python: if self.python:
command.append(sys.executable) command.append(sys.executable)