changeset: 80576:fe2200c1c2d3 branch: 3.3 parent: 80571:7359ade2ab0b user: Vinay Sajip date: Fri Nov 23 19:16:49 2012 +0000 files: Lib/site.py description: Issue #16519: Used os.path.abspath, removed unnecessary code for executable_name. diff -r 7359ade2ab0b -r fe2200c1c2d3 Lib/site.py --- a/Lib/site.py Fri Nov 23 19:46:29 2012 +0200 +++ b/Lib/site.py Fri Nov 23 19:16:49 2012 +0000 @@ -503,15 +503,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)