Closes #15173: Tidied up copyright statements and removed pythonv references.

This commit is contained in:
Vinay Sajip 2012-06-25 00:47:46 +01:00
parent e51a36922f
commit 2895244653
4 changed files with 14 additions and 14 deletions

View File

@ -499,8 +499,8 @@ def venv(known_paths):
global PREFIXES, ENABLE_USER_SITE global PREFIXES, ENABLE_USER_SITE
env = os.environ env = os.environ
if sys.platform == 'darwin' and '__PYTHONV_LAUNCHER__' in env: if sys.platform == 'darwin' and '__PYVENV_LAUNCHER__' in env:
executable = os.environ['__PYTHONV_LAUNCHER__'] executable = os.environ['__PYVENV_LAUNCHER__']
else: else:
executable = sys.executable executable = sys.executable
executable_dir, executable_name = os.path.split(executable) executable_dir, executable_name = os.path.split(executable)

View File

@ -2,6 +2,7 @@
Test harness for the venv module. Test harness for the venv module.
Copyright (C) 2011-2012 Vinay Sajip. Copyright (C) 2011-2012 Vinay Sajip.
Licensed to the PSF under a contributor agreement.
""" """
import os import os
@ -29,8 +30,8 @@ class BaseTest(unittest.TestCase):
self.pydocname = 'pydoc' self.pydocname = 'pydoc'
self.lib = ('lib', 'python%s' % sys.version[:3]) self.lib = ('lib', 'python%s' % sys.version[:3])
self.include = 'include' self.include = 'include'
if sys.platform == 'darwin' and '__PYTHONV_LAUNCHER__' in os.environ: if sys.platform == 'darwin' and '__PYVENV_LAUNCHER__' in os.environ:
executable = os.environ['__PYTHONV_LAUNCHER__'] executable = os.environ['__PYVENV_LAUNCHER__']
else: else:
executable = sys.executable executable = sys.executable
self.exe = os.path.split(executable)[-1] self.exe = os.path.split(executable)[-1]
@ -69,9 +70,9 @@ class BasicTest(BaseTest):
self.isdir(self.include) self.isdir(self.include)
self.isdir(*self.lib) self.isdir(*self.lib)
data = self.get_text_file_contents('pyvenv.cfg') data = self.get_text_file_contents('pyvenv.cfg')
if sys.platform == 'darwin' and ('__PYTHONV_LAUNCHER__' if sys.platform == 'darwin' and ('__PYVENV_LAUNCHER__'
in os.environ): in os.environ):
executable = os.environ['__PYTHONV_LAUNCHER__'] executable = os.environ['__PYVENV_LAUNCHER__']
else: else:
executable = sys.executable executable = sys.executable
path = os.path.dirname(executable) path = os.path.dirname(executable)
@ -127,7 +128,7 @@ class BasicTest(BaseTest):
for usl in (False, True): for usl in (False, True):
builder = venv.EnvBuilder(clear=True, symlinks=usl) builder = venv.EnvBuilder(clear=True, symlinks=usl)
if (usl and sys.platform == 'darwin' and if (usl and sys.platform == 'darwin' and
'__PYTHONV_LAUNCHER__' in os.environ): '__PYVENV_LAUNCHER__' in os.environ):
self.assertRaises(ValueError, builder.create, self.env_dir) self.assertRaises(ValueError, builder.create, self.env_dir)
else: else:
builder.create(self.env_dir) builder.create(self.env_dir)

View File

@ -1,7 +1,8 @@
""" """
Virtual environment (venv) package for Python. Based on PEP 405. Virtual environment (venv) package for Python. Based on PEP 405.
Copyright (C) 20011-2012 Vinay Sajip. All Rights Reserved. Copyright (C) 2011-2012 Vinay Sajip.
Licensed to the PSF under a contributor agreement.
usage: python -m venv [-h] [--system-site-packages] [--symlinks] [--clear] usage: python -m venv [-h] [--system-site-packages] [--symlinks] [--clear]
[--upgrade] [--upgrade]
@ -36,7 +37,6 @@ try:
import threading import threading
except ImportError: except ImportError:
threading = None threading = None
import zipfile
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -119,8 +119,8 @@ class EnvBuilder:
context.prompt = '(%s) ' % context.env_name context.prompt = '(%s) ' % context.env_name
create_if_needed(env_dir) create_if_needed(env_dir)
env = os.environ env = os.environ
if sys.platform == 'darwin' and '__PYTHONV_LAUNCHER__' in env: if sys.platform == 'darwin' and '__PYVENV_LAUNCHER__' in env:
executable = os.environ['__PYTHONV_LAUNCHER__'] executable = os.environ['__PYVENV_LAUNCHER__']
else: else:
executable = sys.executable executable = sys.executable
dirname, exename = os.path.split(os.path.abspath(executable)) dirname, exename = os.path.split(os.path.abspath(executable))
@ -346,8 +346,7 @@ def main(args=None):
elif not hasattr(sys, 'base_prefix'): elif not hasattr(sys, 'base_prefix'):
compatible = False compatible = False
if not compatible: if not compatible:
raise ValueError('This script is only for use with ' raise ValueError('This script is only for use with Python 3.3')
'Python 3.3 (pythonv variant)')
else: else:
import argparse import argparse

View File

@ -159,7 +159,7 @@ main(int argc, char **argv) {
status = _NSGetExecutablePath(path, &size); status = _NSGetExecutablePath(path, &size);
if (status == 0) { if (status == 0) {
if (realpath(path, real_path) != NULL) { if (realpath(path, real_path) != NULL) {
setenv("__PYTHONV_LAUNCHER__", real_path, 1); setenv("__PYVENV_LAUNCHER__", real_path, 1);
} }
} }