Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-81057: Move More Globals in Core Code to _PyRuntimeState#99516

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
18 commits
Select commitHold shift + click to select a range
caec551
Drop outdated whitelist entries.
ericsnowcurrentlyNov 15, 2022
f6b90ee
Move make_pending_calls():busy to _PyRuntimeState.
ericsnowcurrentlyNov 15, 2022
a6be5a3
Move urandom_cache to _PyRuntimeState.
ericsnowcurrentlyNov 15, 2022
fb33ede
Move float_format/double_format to _PyRuntimeState.
ericsnowcurrentlyNov 15, 2022
bd1a66d
Special-case the hash secret.
ericsnowcurrentlyNov 15, 2022
1da0a33
Re-organize the ingored list.
ericsnowcurrentlyNov 15, 2022
03481e2
Drop an old global from the ingored list.
ericsnowcurrentlyNov 15, 2022
e50ea07
Only initialize bloom_linebreak once in the process.
ericsnowcurrentlyNov 15, 2022
a55e26a
Clarify an ignore list header.
ericsnowcurrentlyNov 15, 2022
fd3ec40
Move memo_statistics to the ignored list.
ericsnowcurrentlyNov 15, 2022
d04d9da
runtime.unicode_ids -> runtime.unicode_state.ids.
ericsnowcurrentlyNov 15, 2022
4e13ded
Move force_ascii to _PyRuntimeState.
ericsnowcurrentlyNov 15, 2022
e8ad283
Move _Py_PackageContext to _PyRuntimeState.
ericsnowcurrentlyNov 15, 2022
22135f7
Move _Py_FatalErrorFormat():reentrant to the ignored list.
ericsnowcurrentlyNov 15, 2022
426b34e
Move PyFPE_counter to the ignored list.
ericsnowcurrentlyNov 15, 2022
ffdd34a
Move _Py_UnhandledKeyboardInterrupt to _PyRuntimeState.
ericsnowcurrentlyNov 15, 2022
248a69c
Fix pyhash_runtime_state on Windows.
ericsnowcurrentlyNov 15, 2022
a4a55d1
Fix pyhash_runtime_state on Windows.
ericsnowcurrentlyNov 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Move _Py_PackageContext to _PyRuntimeState.
  • Loading branch information
@ericsnowcurrently
ericsnowcurrently committedNov 15, 2022
commite8ad283237a22a36bb584e7ef16fce09881ff3c8
2 changes: 0 additions & 2 deletionsInclude/cpython/modsupport.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -106,5 +106,3 @@ PyAPI_FUNC(PyObject * const *) _PyArg_UnpackKeywordsWithVararg(
(minpos), (maxpos), (minkw), (buf)))

PyAPI_FUNC(PyObject *) _PyModule_CreateInitialized(PyModuleDef*, int apiver);

PyAPI_DATA(const char *) _Py_PackageContext;
2 changes: 2 additions & 0 deletionsInclude/internal/pycore_import.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,6 +32,8 @@ struct _import_runtime_state {
_PyTime_t accumulated;
int header;
} find_and_load;
/* Package context -- the full module name for package imports */
const char * pkgcontext;
};


Expand Down
2 changes: 2 additions & 0 deletionsObjects/moduleobject.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -218,13 +218,15 @@ _PyModule_CreateInitialized(PyModuleDef* module, int module_api_version)
_Py_PackageContext, and PyModule_Create*() will substitute this
(if the name actually matches).
*/
#define _Py_PackageContext (_PyRuntime.imports.pkgcontext)
if (_Py_PackageContext != NULL) {
const char *p = strrchr(_Py_PackageContext, '.');
if (p != NULL && strcmp(module->m_name, p+1) == 0) {
name = _Py_PackageContext;
_Py_PackageContext = NULL;
}
}
#undef _Py_PackageContext
if ((m = (PyModuleObject*)PyModule_New(name)) == NULL)
return NULL;

Expand Down
2 changes: 2 additions & 0 deletionsPython/importdl.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -160,6 +160,7 @@ _PyImport_LoadDynamicModuleWithSpec(PyObject *spec, FILE *fp)
p0 = (PyModInitFunction)exportfunc;

/* Package context is needed for single-phase init */
#define _Py_PackageContext (_PyRuntime.imports.pkgcontext)
oldcontext = _Py_PackageContext;
_Py_PackageContext = PyUnicode_AsUTF8(name_unicode);
if (_Py_PackageContext == NULL) {
Expand All@@ -168,6 +169,7 @@ _PyImport_LoadDynamicModuleWithSpec(PyObject *spec, FILE *fp)
}
m = _PyImport_InitFunc_TrampolineCall(p0);
_Py_PackageContext = oldcontext;
#undef _Py_PackageContext

if (m == NULL) {
if (!PyErr_Occurred()) {
Expand Down
3 changes: 0 additions & 3 deletionsPython/modsupport.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,9 +10,6 @@ typedef double va_double;
static PyObject *va_build_value(const char *, va_list, int);
static PyObject **va_build_stack(PyObject **small_stack, Py_ssize_t small_stack_len, const char *, va_list, int, Py_ssize_t*);

/* Package context -- the full module name for package imports */
const char *_Py_PackageContext = NULL;


int
_Py_convert_optional_to_ssize_t(PyObject *obj, void *result)
Expand Down
1 change: 0 additions & 1 deletionTools/c-analyzer/cpython/globals-to-fix.tsv
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -332,7 +332,6 @@ Objects/dictobject.c-_pydict_global_version-
Objects/dictobject.c-next_dict_keys_version-
Objects/funcobject.c-next_func_version-
Objects/object.c-_Py_RefTotal-
Python/modsupport.c-_Py_PackageContext-
Python/perf_trampoline.c-perf_status-
Python/perf_trampoline.c-extra_code_index-
Python/perf_trampoline.c-code_arena-
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp