]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #16519: Used os.path.abspath, removed unnecessary code for executable_name.
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Fri, 23 Nov 2012 19:16:49 +0000 (19:16 +0000)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Fri, 23 Nov 2012 19:16:49 +0000 (19:16 +0000)
Lib/site.py

index 0aaf46b62f055975fc6a6e866bee67c5aee48710..b751006c88e85ae8ed90f1d15de59430add8bc15 100644 (file)
@@ -503,15 +503,13 @@ def venv(known_paths):
         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)