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
8f9f4665
Commit
8f9f4665
authored
Aug 01, 2010
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1690103: fix initial namespace for code run with trace.main().
parent
920bc0fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
Lib/trace.py
Lib/trace.py
+8
-1
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/trace.py
View file @
8f9f4665
...
...
@@ -799,7 +799,14 @@ def main(argv=None):
try
:
with
open
(
progname
)
as
fp
:
code
=
compile
(
fp
.
read
(),
progname
,
'exec'
)
t
.
run
(
code
)
# try to emulate __main__ namespace as much as possible
globs
=
{
'__file__'
:
progname
,
'__name__'
:
'__main__'
,
'__package__'
:
None
,
'__cached__'
:
None
,
}
t
.
runctx
(
code
,
globs
,
globs
)
except
IOError
as
err
:
_err_exit
(
"Cannot run file %r because: %s"
%
(
sys
.
argv
[
0
],
err
))
except
SystemExit
:
...
...
Misc/NEWS
View file @
8f9f4665
...
...
@@ -15,6 +15,8 @@ Core and Builtins
Library
-------
- Issue #1690103: Fix initial namespace for code run with trace.main().
- Issue #7395: Fix tracebacks in pstats interactive browser.
- Issue #8230: Fix Lib/test/sortperf.py.
...
...
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