Skip to content

Commit 552ce57

Browse files
authored
gh-139227: Remove unused _PyRuntime.imports.pkgcontext (#151490)
The global variable has been replaced by a new thread local variable "pkgcontext" in Python/import.c.
1 parent 0ec7c9d commit 552ce57

2 files changed

Lines changed: 0 additions & 5 deletions

File tree

Include/internal/pycore_interp_structs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,6 @@ struct _import_runtime_state {
308308
Modules are added there and looked up in _imp.find_extension(). */
309309
struct _Py_hashtable_t *hashtable;
310310
} extensions;
311-
/* Package context -- the full module name for package imports */
312-
const char * pkgcontext;
313311
};
314312

315313
struct _import_state {

Python/import.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ static struct _inittab *inittab_copy = NULL;
8181
#define LAST_MODULE_INDEX _PyRuntime.imports.last_module_index
8282
#define EXTENSIONS _PyRuntime.imports.extensions
8383

84-
#define PKGCONTEXT (_PyRuntime.imports.pkgcontext)
85-
8684

8785
/*******************************/
8886
/* interpreter import state */
@@ -883,7 +881,6 @@ _PyImport_ClearModulesByIndex(PyInterpreterState *interp)
883881
*/
884882

885883
static _Py_thread_local const char *pkgcontext = NULL;
886-
# undef PKGCONTEXT
887884
# define PKGCONTEXT pkgcontext
888885

889886
const char *

0 commit comments

Comments
 (0)