8000 GH-127970: find the runtime library when dladdr is available by FFY00 · Pull Request #127972 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-127970: find the runtime library when dladdr is available #127972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jan 8, 2025
Prev Previous commit
Next Next commit
Move path definition to inside HAVE_DLADDR
Signed-off-by: Filipe Laíns <lains@riseup.net
  • Loading branch information
FFY00 committed Dec 15, 2024
commit 5230b615ede7c4103bc2ac2ef0f675d15e29a9b2
2 changes: 1 addition & 1 deletion Modules/getpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,6 @@ static int
library_to_dict(PyObject *dict, const char *key)
{
#ifdef Py_ENABLE_SHARED
char path[MAXPATHLEN + 1];

#ifdef MS_WINDOWS
extern HMODULE PyWin_DLLhModule;
Expand All @@ -817,6 +816,7 @@ library_to_dict(PyObject *dict, const char *key)
#endif

#if HAVE_DLADDR
char path[MAXPATHLEN + 1];
Dl_info libpython_info;
if (dladdr(&Py_Initialize, &libpython_info) && libpython_info.dli_fname) {
strncpy(path, libpython_info.dli_fname, MAXPATHLEN);
Expand Down
Loading
0