Skip to content

Commit 38f0571

Browse files
committed
restore stable ABI symbols
1 parent 18f7146 commit 38f0571

File tree

6 files changed

+84
-2
lines changed

6 files changed

+84
-2
lines changed

Doc/data/stable_abi.dat

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/pylifecycle.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ PyAPI_FUNC(int) Py_BytesMain(int argc, char **argv);
3535

3636
/* In pathconfig.c */
3737
Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *);
38-
3938
Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *);
4039

4140
#ifdef MS_WINDOWS

Lib/test/test_stable_abi_ctypes.py

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Misc/stable_abi.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,8 +1630,20 @@
16301630
added = '3.2'
16311631
[function.Py_GetCopyright]
16321632
added = '3.2'
1633+
[function.Py_GetExecPrefix]
1634+
added = '3.2'
1635+
[function.Py_GetPath]
1636+
added = '3.2'
16331637
[function.Py_GetPlatform]
16341638
added = '3.2'
1639+
[function.Py_GetPrefix]
1640+
added = '3.2'
1641+
[function.Py_GetProgramFullPath]
1642+
added = '3.2'
1643+
[function.Py_GetProgramName]
1644+
added = '3.2'
1645+
[function.Py_GetPythonHome]
1646+
added = '3.2'
16351647
[function.Py_GetRecursionLimit]
16361648
added = '3.2'
16371649
[function.Py_GetVersion]

PC/python3dll.c

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/pathconfig.c

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,20 @@ Py_SetProgramName(const wchar_t *program_name)
272272
}
273273

274274

275-
wchar_t *
275+
/* removed in 3.15, but kept for stable ABI compatibility */
276+
PyAPI_FUNC(wchar_t *)
277+
Py_GetPath(void)
278+
{
279+
/* If the user has provided a path, return that */
280+
if (_Py_path_config.module_search_path) {
281+
return _Py_path_config.module_search_path;
282+
}
283+
/* If we have already done calculations, return the calculated path */
284+
return _Py_path_config.calculated_module_search_path;
285+
}
286+
287+
288+
PyAPI_FUNC(wchar_t *)
276289
_Py_GetStdlibDir(void)
277290
{
278291
wchar_t *stdlib_dir = _Py_path_config.stdlib_dir;
@@ -282,6 +295,46 @@ _Py_GetStdlibDir(void)
282295
return NULL;
283296
}
284297

298+
/* removed in 3.15, but kept for stable ABI compatibility */
299+
PyAPI_FUNC(wchar_t *)
300+
Py_GetPrefix(void)
301+
{
302+
return _Py_path_config.prefix;
303+
}
304+
305+
306+
/* removed in 3.15, but kept for stable ABI compatibility */
307+
PyAPI_FUNC(wchar_t *)
308+
Py_GetExecPrefix(void)
309+
{
310+
return _Py_path_config.exec_prefix;
311+
}
312+
313+
314+
/* removed in 3.15, but kept for stable ABI compatibility */
315+
PyAPI_FUNC(wchar_t *)
316+
Py_GetProgramFullPath(void)
317+
{
318+
return _Py_path_config.program_full_path;
319+
}
320+
321+
322+
/* removed in 3.15, but kept for stable ABI compatibility */
323+
PyAPI_FUNC(wchar_t *)
324+
Py_GetPythonHome(void)
325+
{
326+
return _Py_path_config.home;
327+
}
328+
329+
330+
/* removed in 3.15, but kept for stable ABI compatibility */
331+
PyAPI_FUNC(wchar_t *)
332+
Py_GetProgramName(void)
333+
{
334+
return _Py_path_config.program_name;
335+
}
336+
337+
285338

286339
/* Compute module search path from argv[0] or the current working
287340
directory ("-m module" case) which will be prepended to sys.argv:

0 commit comments

Comments
 (0)