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

Commit05a19b5

Browse files
gh-120170: Exclude __mp_main__ in C version of whichmodule() (#120171)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
1 parent393773a commit05a19b5

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix an issue in the:mod:`!_pickle` extension module in which importing
2+
:mod:`multiprocessing` could change how pickle identifies which module an
3+
object belongs to, potentially breaking the unpickling of those objects.

‎Modules/_pickle.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,6 +1879,10 @@ _checkmodule(PyObject *module_name, PyObject *module,
18791879
_PyUnicode_EqualToASCIIString(module_name,"__main__")) {
18801880
return-1;
18811881
}
1882+
if (PyUnicode_Check(module_name)&&
1883+
_PyUnicode_EqualToASCIIString(module_name,"__mp_main__")) {
1884+
return-1;
1885+
}
18821886

18831887
PyObject*candidate=getattribute(module,dotted_path,0);
18841888
if (candidate==NULL) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp