summaryrefslogtreecommitdiffstats
path: root/Lib/site.py
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2012-11-23 19:16:49 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2012-11-23 19:16:49 (GMT)
commit27e4b6059e6414d88c7284bbcccebb55b0957bc5 (patch)
tree25fbf84bfd4d61668b3f722975faf49630e769e4 /Lib/site.py
parent44dcd6bcb20629c660560769bed9d0ba39a173d0 (diff)
downloadcpython-27e4b6059e6414d88c7284bbcccebb55b0957bc5.zip
cpython-27e4b6059e6414d88c7284bbcccebb55b0957bc5.tar.gz
cpython-27e4b6059e6414d88c7284bbcccebb55b0957bc5.tar.bz2
Issue #16519: Used os.path.abspath, removed unnecessary code for executable_name.
Diffstat (limited to 'Lib/site.py')
-rw-r--r--Lib/site.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/site.py b/Lib/site.py
index 0aaf46b..b751006 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -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)