@@ -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 > / "pythonXY.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 ();
@@ -1426,6 +1428,11 @@ static PyStatus
1426
1428
calculate_init (PyCalculatePath * calculate , const PyConfig * config )
1427
1429
{
1428
1430
size_t len ;
1431
+
1432
+ calculate -> warnings = config -> pathconfig_warnings ;
1433
+ calculate -> pythonpath_env = config -> pythonpath_env ;
1434
+ calculate -> platlibdir = config -> platlibdir ;
1435
+
1429
1436
const char * path = getenv ("PATH" );
1430
1437
if (path ) {
1431
1438
calculate -> path_env = Py_DecodeLocale (path , & len );
@@ -1452,14 +1459,16 @@ calculate_init(PyCalculatePath *calculate, const PyConfig *config)
1452
1459
return DECODE_LOCALE_ERR ("VPATH macro" , len );
1453
1460
}
1454
1461
1455
- calculate -> lib_python = Py_DecodeLocale (PLATLIBDIR "/python" VERSION , & len );
1456
- if (!calculate -> lib_python ) {
1462
+ // <platlibdir> / "pythonX.Y"
1463
+ wchar_t * pyversion = Py_DecodeLocale ("python" VERSION , & len );
1464
+ if (!pyversion ) {
1457
1465
return DECODE_LOCALE_ERR ("VERSION macro" , len );
1458
1466
}
1459
-
1460
- calculate -> warnings = config -> pathconfig_warnings ;
1461
- calculate -> pythonpath_env = config -> pythonpath_env ;
1462
- calculate -> platlibdir = config -> platlibdir ;
1467
+ calculate -> lib_python = joinpath2 (config -> platlibdir , pyversion );
1468
+ PyMem_RawFree (pyversion );
1469
+ if (calculate -> lib_python == NULL ) {
1470
+ return _PyStatus_NO_MEMORY ();
1471
+ }
1463
1472
1464
1473
return _PyStatus_OK ();
1465
1474
}
0 commit comments