Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kirill Smelkov
cpython
Commits
4518823a
Commit
4518823a
authored
27 years ago
by
Guido van Rossum
Browse files
Options
Download
Email Patches
Plain Diff
In whichmodule(), use __module__ if set.
parent
b6c935a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
Modules/cPickle.c
Modules/cPickle.c
+4
-0
No files found.
Modules/cPickle.c
View file @
4518823a
...
...
@@ -632,6 +632,10 @@ whichmodule(PyObject *global, PyObject *global_name) {
PyObject
*
module
=
0
,
*
modules_dict
=
0
,
*
global_name_attr
=
0
,
*
name
=
0
;
module
=
PyObject_GetAttrString
(
global
,
"__module__"
);
if
(
module
)
return
module
;
PyErr_Clear
();
if
((
module
=
PyDict_GetItem
(
class_map
,
global
)))
{
Py_INCREF
(
module
);
return
module
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment