[Python-checkins] cpython (merge 3.3 -> default): Closes #16519: Merged fix from 3.3.

vinay.sajip python-checkins at python.org
Fri Nov 23 20:22:51 CET 2012


http://hg.python.org/cpython/rev/a874c4a6ad5f
changeset: 80577:a874c4a6ad5f
parent: 80572:a728056347ec
parent: 80576:fe2200c1c2d3
user: Vinay Sajip <vinay_sajip at yahoo.co.uk>
date: Fri Nov 23 19:21:46 2012 +0000
summary:
 Closes #16519: Merged fix from 3.3.
files:
 Lib/site.py | 8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/Lib/site.py b/Lib/site.py
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -484,15 +484,13 @@
 executable = os.environ['__PYVENV_LAUNCHER__']
 else:
 executable = sys.executable
- executable_dir, executable_name = os.path.split(executable)
- site_prefix = os.path.dirname(executable_dir)
+ exe_dir, _ = os.path.split(os.path.abspath(executable))
+ site_prefix = os.path.dirname(exe_dir)
 sys._home = None
- if sys.platform == 'win32':
- executable_name = os.path.splitext(executable_name)[0]
 conf_basename = 'pyvenv.cfg'
 candidate_confs = [
 conffile for conffile in (
- os.path.join(executable_dir, conf_basename),
+ os.path.join(exe_dir, conf_basename),
 os.path.join(site_prefix, conf_basename)
 )
 if os.path.isfile(conffile)
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /