Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5b613dd8
Commit
5b613dd8
authored
Feb 10, 2016
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #25698: Prevent possible replacing imported module with the empty one
if the stack is too deep.
parents
288ed038
48a583b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
Python/import.c
Python/import.c
+6
-2
No files found.
Python/import.c
View file @
5b613dd8
...
...
@@ -671,9 +671,13 @@ PyImport_AddModuleObject(PyObject *name)
PyObject
*
modules
=
PyImport_GetModuleDict
();
PyObject
*
m
;
if
((
m
=
PyDict_GetItem
(
modules
,
name
))
!=
NULL
&&
PyModule_Check
(
m
))
if
((
m
=
PyDict_GetItem
WithError
(
modules
,
name
))
!=
NULL
&&
PyModule_Check
(
m
))
{
return
m
;
}
if
(
PyErr_Occurred
())
{
return
NULL
;
}
m
=
PyModule_NewObject
(
name
);
if
(
m
==
NULL
)
return
NULL
;
...
...
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