@@ -130,7 +130,7 @@ typedef struct {
130
130
wchar_t * exec_prefix_macro ; /* EXEC_PREFIX macro */
131
131
wchar_t * vpath_macro ; /* VPATH macro */
132
132
133
- wchar_t * lib_python ; /* "lib/ pythonX.Y" */
133
+ wchar_t * lib_python ; /* <platlibdir> / " pythonX.Y" */
134
134
135
135
int prefix_found ; /* found platform independent libraries? */
136
136
int exec_prefix_found ; /* found the platform dependent libraries? */
@@ -810,7 +810,7 @@ calculate_exec_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig)
810
810
"Could not find platform dependent libraries <exec_prefix>\n" );
811
811
}
812
812
813
- /* <PLATLIBDIR > / "lib-dynload" */
813
+ /* <platlibdir > / "lib-dynload" */
814
814
wchar_t * lib_dynload = joinpath2 (calculate -> platlibdir ,
815
815
L"lib-dynload" );
816
816
if (lib_dynload == NULL ) {
@@ -1296,16 +1296,18 @@ calculate_zip_path(PyCalculatePath *calculate)
1296
1296
{
1297
1297
PyStatus res ;
1298
1298
1299
- /* Path: <PLATLIBDIR> / "pythonXY.zip" */
1300
- wchar_t * path = joinpath2 (calculate -> platlibdir , L"python" Py_STRINGIFY (PY_MAJOR_VERSION ) Py_STRINGIFY (PY_MINOR_VERSION ) L".zip" );
1299
+ /* Path: <platlibdir> / "pythonXY.zip" */
1300
+ wchar_t * path = joinpath2 (calculate -> platlibdir ,
1301
+ L"python" Py_STRINGIFY (PY_MAJOR_VERSION ) Py_STRINGIFY (PY_MINOR_VERSION )
1302
+ L".zip" );
1301
1303
if (path == NULL ) {
1302
1304
return _PyStatus_NO_MEMORY ();
1303
1305
}
1304
1306
1305
1307
if (calculate -> prefix_found > 0 ) {
1306
1308
/* Use the reduced prefix returned by Py_GetPrefix()
1307
1309
1308
- Path: <basename(basename(prefix))> / <PLATLIBDIR > / "python00 .zip" */
1310
+ Path: <basename(basename(prefix))> / <platlibdir > / "pythonXY .zip" */
1309
1311
wchar_t * parent = _PyMem_RawWcsdup (calculate -> prefix );
1310
1312
if (parent == NULL ) {
1311
1313
res = _PyStatus_NO_MEMORY ();
@@ -1431,6 +1433,11 @@ static PyStatus
1431
1433
calculate_init (PyCalculatePath * calculate , const PyConfig * config )
1432
1434
{
1433
1435
size_t len ;
1436
+
1437
+ calculate -> warnings = config -> pathconfig_warnings ;
1438
+ calculate -> pythonpath_env = config -> pythonpath_env ;
1439
+ calculate -> platlibdir = config -> platlibdir ;
1440
+
1434
1441
const char * path = getenv ("PATH" );
1435
1442
if (path ) {
1436
1443
calculate -> path_env = Py_DecodeLocale (path , & len );
@@ -1457,14 +1464,16 @@ calculate_init(PyCalculatePath *calculate, const PyConfig *config)
1457
1464
return DECODE_LOCALE_ERR ("VPATH macro" , len );
1458
1465
}
1459
1466
1460
- calculate -> lib_python = Py_DecodeLocale (PLATLIBDIR "/python" VERSION , & len );
1461
- if (!calculate -> lib_python ) {
1467
+ // <platlibdir> / "pythonX.Y"
1468
+ wchar_t * pyversion = Py_DecodeLocale ("python" VERSION , & len );
1469
+ if (!pyversion ) {
1462
1470
return DECODE_LOCALE_ERR ("VERSION macro" , len );
1463
1471
}
1464
-
1465
- calculate -> warnings = config -> pathconfig_warnings ;
1466
- calculate -> pythonpath_env = config -> pythonpath_env ;
1467
- calculate -> platlibdir = config -> platlibdir ;
1472
+ calculate -> lib_python = joinpath2 (config -> platlibdir , pyversion );
1473
+ PyMem_RawFree (pyversion );
1474
+ if (calculate -> lib_python == NULL ) {
1475
+ return _PyStatus_NO_MEMORY ();
1476
+ }
1468
1477
1469
1478
return _PyStatus_OK ();
1470
1479
}
0 commit comments