Skip to content

Commit f6bb2d5

Browse files
author
Peter Goodman
authored
Merge pull request #41 from trailofbits/fix_python_version_xed
Check for the python3 version
2 parents 254eab2 + 038fdfc commit f6bb2d5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkgman/installers/common.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,17 @@ def get_python_path(version):
6060
if sys.platform == "win32":
6161
extension = ".exe"
6262

63+
version_string = str(version)
64+
if sys.version_info[0] == 3 and \
65+
sys.version_info[1] > 0:
66+
version_string = str(sys.version_info[0]) + \
67+
"." + str(sys.version_info[1])
68+
69+
# Check for the exact version executable first
70+
path = spawn.find_executable("python" + version_string + extension)
71+
if path is not None:
72+
return path
73+
6374
path = spawn.find_executable("python" + str(version) + extension)
6475
if path is not None:
6576
return path

0 commit comments

Comments
 (0)