Commit a03a28da authored by Jim Fulton's avatar Jim Fulton

Fixes in response to pull-request comments

parent ec55b025
...@@ -57,7 +57,7 @@ options, args = parser.parse_args() ...@@ -57,7 +57,7 @@ options, args = parser.parse_args()
# handle -S # handle -S
def normpath(p): def normpath(p):
return p[:-1] if p.endswith('/') else p return p[:-1] if p.endswith(os.path.sep) else p
nosite = 'site' not in sys.modules nosite = 'site' not in sys.modules
if nosite: if nosite:
...@@ -153,8 +153,6 @@ if version: ...@@ -153,8 +153,6 @@ if version:
requirement = '=='.join((requirement, version)) requirement = '=='.join((requirement, version))
cmd.append(requirement) cmd.append(requirement)
print 'requirement', requirement
import subprocess import subprocess
if subprocess.call(cmd, env=env) != 0: if subprocess.call(cmd, env=env) != 0:
raise Exception( raise Exception(
......
...@@ -30,7 +30,7 @@ if os.path.isdir('build'): ...@@ -30,7 +30,7 @@ if os.path.isdir('build'):
# handle -S # handle -S
def normpath(p): def normpath(p):
return p[:-1] if p.endswith('/') else p return p[:-1] if p.endswith(os.path.sep) else p
nosite = 'site' not in sys.modules nosite = 'site' not in sys.modules
if nosite: if nosite:
......
...@@ -18,13 +18,15 @@ It doesn't install scripts. It uses distribute and requires it to be ...@@ -18,13 +18,15 @@ It doesn't install scripts. It uses distribute and requires it to be
installed. installed.
""" """
import os
import sys import sys
###################################################################### ######################################################################
# handle -S # handle -S
def normpath(p): def normpath(p):
return p[:-1] if p.endswith('/') else p return p[:-1] if p.endswith(os.path.sep) else p
no_site = 'site' not in sys.modules no_site = 'site' not in sys.modules
if no_site: if no_site:
initial_paths = set(map(normpath, sys.path)) initial_paths = set(map(normpath, sys.path))
...@@ -36,7 +38,6 @@ if no_site: ...@@ -36,7 +38,6 @@ if no_site:
import distutils.errors import distutils.errors
import glob import glob
import logging import logging
import os
import pkg_resources import pkg_resources
import py_compile import py_compile
import re import re
...@@ -1014,7 +1015,7 @@ def _script(module_name, attrs, path, dest, arguments, initialization, rsetup): ...@@ -1014,7 +1015,7 @@ def _script(module_name, attrs, path, dest, arguments, initialization, rsetup):
python = _safe_arg(sys.executable) python = _safe_arg(sys.executable)
if no_site: if no_site:
python += ' -S' python += ' -S'
contents = script_template % dict( contents = script_template % dict(
python = python, python = python,
...@@ -1038,7 +1039,7 @@ def _distutils_script(path, dest, script_content, initialization, rsetup): ...@@ -1038,7 +1039,7 @@ def _distutils_script(path, dest, script_content, initialization, rsetup):
python = _safe_arg(sys.executable) python = _safe_arg(sys.executable)
if no_site: if no_site:
python += ' -S' python += ' -S'
contents = distutils_script_template % dict( contents = distutils_script_template % dict(
python = python, python = python,
...@@ -1121,7 +1122,7 @@ def _pyscript(path, dest, rsetup): ...@@ -1121,7 +1122,7 @@ def _pyscript(path, dest, rsetup):
python = _safe_arg(sys.executable) python = _safe_arg(sys.executable)
if no_site: if no_site:
python += ' -S' python += ' -S'
contents = py_script_template % dict( contents = py_script_template % dict(
python = python, python = python,
......
...@@ -16,7 +16,8 @@ applications: ...@@ -16,7 +16,8 @@ applications:
2. Use a 'virtual environment 2. Use a 'virtual environment
<http://pypi.python.org/pypi/virtualenv>'_ that wraps a Python <http://pypi.python.org/pypi/virtualenv>'_ that wraps a Python
installation in a way that hides 3rd-party modules. installation in a way that hides 3rd-party modules. `This is buildt
into Python 3.3 <http://docs.python.org/dev/library/venv.html>`_
3. Use the -S Python option when bootstrapping buildout. This will 3. Use the -S Python option when bootstrapping buildout. This will
bypass the normal execution of the Python site.py file, which is bypass the normal execution of the Python site.py file, which is
...@@ -125,4 +126,5 @@ The -S option is also used when invoking setup scripts. ...@@ -125,4 +126,5 @@ The -S option is also used when invoking setup scripts.
3rd-party libraries that are added to the Python path regardless of 3rd-party libraries that are added to the Python path regardless of
whether site.py is loaded. Still, even on Mac OS X, use of the -S whether site.py is loaded. Still, even on Mac OS X, use of the -S
option prevents some 3rd-party modules from being added to the option prevents some 3rd-party modules from being added to the
Python path, Python path.
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