Commit 1fc67a9c authored by Jim Fulton's avatar Jim Fulton

Check hygene before importing site or installing distribute.

parent 493394b7
...@@ -26,13 +26,26 @@ for d in 'eggs', 'develop-eggs', 'bin', 'parts': ...@@ -26,13 +26,26 @@ for d in 'eggs', 'develop-eggs', 'bin', 'parts':
if os.path.isdir('build'): if os.path.isdir('build'):
shutil.rmtree('build') shutil.rmtree('build')
nosite = 'site' not in sys.modules
######################################################################
# Make sure we have a relatively clean environment
try:
import pkg_resources, setuptools
except ImportError:
pass
else:
raise SystemError(
"Buildout development with a pre-installed setuptools or "
"distribute is not supported.%s"
% ('' if nosite else ' Try running with -S option to Python.'))
###################################################################### ######################################################################
# handle -S # handle -S
def normpath(p): def normpath(p):
return p[:-1] if p.endswith(os.path.sep) else p return p[:-1] if p.endswith(os.path.sep) else p
nosite = 'site' not in sys.modules
if nosite: if nosite:
# They've asked not to import site. Cool, but distribute is going to # They've asked not to import site. Cool, but distribute is going to
# import it anyway, so we're going to have to clean up. :( # import it anyway, so we're going to have to clean up. :(
...@@ -42,18 +55,6 @@ if nosite: ...@@ -42,18 +55,6 @@ if nosite:
else: else:
to_remove = () to_remove = ()
######################################################################
# Make sure we have a relatively clean environment
try:
import pkg_resources, setuptools
except ImportError:
pass
else:
raise SystemError(
"Buildout development with a pre-installed setuptools or "
"distribute is not supported.%s"
% ('' if nosite else ' Try running with -S option to Python.'))
###################################################################### ######################################################################
# Install distribute # Install distribute
ez = {} ez = {}
......
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