Skip to content

Commit

Permalink
Move path definition to inside HAVE_DLADDR
Browse files Browse the repository at this point in the history
Signed-off-by: Filipe Laíns <lains@riseup.net
  • Loading branch information
FFY00 committed Dec 15, 2024
1 parent 08821ee commit 5230b61
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit 5230b61

Please sign in to comment.