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
82daa60d
Commit
82daa60d
authored
Nov 29, 2018
by
INADA Naoki
Committed by
GitHub
Nov 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-30167: Remove __cached__ from __main__ when removing __file__ (GH-7415)
parent
9fbcfc08
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
Misc/NEWS.d/next/Core and Builtins/2018-06-05-15-49-02.bpo-30167.e956hA.rst
...ore and Builtins/2018-06-05-15-49-02.bpo-30167.e956hA.rst
+2
-0
Python/pythonrun.c
Python/pythonrun.c
+8
-2
No files found.
Misc/NEWS.d/next/Core and Builtins/2018-06-05-15-49-02.bpo-30167.e956hA.rst
0 → 100644
View file @
82daa60d
``PyRun_SimpleFileExFlags`` removes ``__cached__`` from module in addition
to ``__file__``.
Python/pythonrun.c
View file @
82daa60d
...
...
@@ -434,8 +434,14 @@ PyRun_SimpleFileExFlags(FILE *fp, const char *filename, int closeit,
Py_DECREF
(
v
);
ret
=
0
;
done:
if
(
set_file_name
&&
PyDict_DelItemString
(
d
,
"__file__"
))
if
(
set_file_name
)
{
if
(
PyDict_DelItemString
(
d
,
"__file__"
))
{
PyErr_Clear
();
}
if
(
PyDict_DelItemString
(
d
,
"__cached__"
))
{
PyErr_Clear
();
}
}
Py_XDECREF
(
m
);
return
ret
;
}
...
...
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