Commit b39058a6 authored by tarek's avatar tarek

shorcut to avoid unecessary work when located in a non-isolated environment

--HG--
branch : distribute
extra : rebase_source : 6b093a48e2647923cf36d1dd7ea74def0a961dc6
parent 8e59ae90
......@@ -181,7 +181,7 @@ def _rename_path(path):
def _remove_flat_installation(placeholder):
if not os.path.isdir(placeholder):
log.warn('Unkown installation')
log.warn('Unkown installation at %s' % placeholder)
return False
found = False
for file in os.listdir(placeholder):
......@@ -295,9 +295,10 @@ def main(argv, version=DEFAULT_VERSION):
import setuptools
if not hasattr(setuptools, '_distribute'):
placeholder = os.path.split(os.path.dirname(setuptools.__file__))[0]
res = _remove_flat_installation(placeholder)
if res:
_relaunch()
if not placeholder.endswith('.egg'):
res = _remove_flat_installation(placeholder)
if res:
_relaunch()
print >> sys.stderr, (
"The patch didn't work, Setuptools is still active.\n"
"Possible reason: your have a system-wide setuptools installed "
......
......@@ -64,6 +64,7 @@ try:
else:
print '**** Test failed, please send me the output at tarek@ziade.org'
finally:
os.remove(script_name)
if os.path.exists(script_name):
os.remove(script_name)
os.remove('bootstrap.py')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment