summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-05-19 16:28:05 (GMT)
committerGitHub <noreply@github.com>2020-05-19 16:28:05 (GMT)
commit2a561b5f6830aee39cf05dc70c24e26c3558dda0 (patch)
tree941cddb98cf127194122814c4c5c3517b32645c1 /Modules
parent2abededbc4165d2daa14ae9d74b1f33cce0593d7 (diff)
downloadcpython-2a561b5f6830aee39cf05dc70c24e26c3558dda0.zip
cpython-2a561b5f6830aee39cf05dc70c24e26c3558dda0.tar.gz
cpython-2a561b5f6830aee39cf05dc70c24e26c3558dda0.tar.bz2
bpo-37616: Handle version information more gracefully in getpath.c (GH-20214)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/getpath.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/Modules/getpath.c b/Modules/getpath.c
index 91cc449..d9829f8 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -1296,8 +1296,8 @@ calculate_zip_path(PyCalculatePath *calculate)
{
PyStatus res;
- /* Path: <PLATLIBDIR> / "python00.zip" */
- wchar_t *path = joinpath2(calculate->platlibdir_macro, L"python000.zip");
+ /* Path: <PLATLIBDIR> / "pythonXY.zip" */
+ wchar_t *path = joinpath2(calculate->platlibdir_macro, L"python" Py_STRINGIFY(PY_MAJOR_VERSION) Py_STRINGIFY(PY_MINOR_VERSION) L".zip");
if (path == NULL) {
return _PyStatus_NO_MEMORY();
}
@@ -1305,7 +1305,7 @@ calculate_zip_path(PyCalculatePath *calculate)
if (calculate->prefix_found > 0) {
/* Use the reduced prefix returned by Py_GetPrefix()
- Path: <basename(basename(prefix))> / <PLATLIBDIR> / "python000.zip" */
+ Path: <basename(basename(prefix))> / <PLATLIBDIR> / "pythonXY.zip" */
wchar_t *parent = _PyMem_RawWcsdup(calculate->prefix);
if (parent == NULL) {
res = _PyStatus_NO_MEMORY();
@@ -1325,12 +1325,6 @@ calculate_zip_path(PyCalculatePath *calculate)
goto done;
}
- /* Replace "000" with the version */
- size_t len = wcslen(calculate->zip_path);
- calculate->zip_path[len - 7] = VERSION[0];
- calculate->zip_path[len - 6] = VERSION[2];
- calculate->zip_path[len - 5] = VERSION[3];
-
res = _PyStatus_OK();
done: