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
71317499
Commit
71317499
authored
Jan 09, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #16491: IDLE now prints chained exception tracebacks.
parents
369a7822
78470b4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
9 deletions
+30
-9
Lib/idlelib/run.py
Lib/idlelib/run.py
+28
-9
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/idlelib/run.py
View file @
71317499
...
...
@@ -171,15 +171,34 @@ def print_exception():
efile
=
sys
.
stderr
typ
,
val
,
tb
=
excinfo
=
sys
.
exc_info
()
sys
.
last_type
,
sys
.
last_value
,
sys
.
last_traceback
=
excinfo
tbe
=
traceback
.
extract_tb
(
tb
)
print
(
'Traceback (most recent call last):'
,
file
=
efile
)
exclude
=
(
"run.py"
,
"rpc.py"
,
"threading.py"
,
"queue.py"
,
"RemoteDebugger.py"
,
"bdb.py"
)
cleanup_traceback
(
tbe
,
exclude
)
traceback
.
print_list
(
tbe
,
file
=
efile
)
lines
=
traceback
.
format_exception_only
(
typ
,
val
)
for
line
in
lines
:
print
(
line
,
end
=
''
,
file
=
efile
)
seen
=
set
()
def
print_exc
(
typ
,
exc
,
tb
):
seen
.
add
(
exc
)
context
=
exc
.
__context__
cause
=
exc
.
__cause__
if
cause
is
not
None
and
cause
not
in
seen
:
print_exc
(
type
(
cause
),
cause
,
cause
.
__traceback__
)
print
(
"
\
n
The above exception was the direct cause "
"of the following exception:
\
n
"
,
file
=
efile
)
elif
(
context
is
not
None
and
not
exc
.
__suppress_context__
and
context
not
in
seen
):
print_exc
(
type
(
context
),
context
,
context
.
__traceback__
)
print
(
"
\
n
During handling of the above exception, "
"another exception occurred:
\
n
"
,
file
=
efile
)
if
tb
:
tbe
=
traceback
.
extract_tb
(
tb
)
print
(
'Traceback (most recent call last):'
,
file
=
efile
)
exclude
=
(
"run.py"
,
"rpc.py"
,
"threading.py"
,
"queue.py"
,
"RemoteDebugger.py"
,
"bdb.py"
)
cleanup_traceback
(
tbe
,
exclude
)
traceback
.
print_list
(
tbe
,
file
=
efile
)
lines
=
traceback
.
format_exception_only
(
typ
,
exc
)
for
line
in
lines
:
print
(
line
,
end
=
''
,
file
=
efile
)
print_exc
(
typ
,
val
,
tb
)
def
cleanup_traceback
(
tb
,
exclude
):
"Remove excluded traces from beginning/end of tb; get cached lines"
...
...
Misc/NEWS
View file @
71317499
...
...
@@ -139,6 +139,8 @@ Core and Builtins
Library
-------
-
Issue
#
16491
:
IDLE
now
prints
chained
exception
tracebacks
.
-
Issue
#
15972
:
Fix
error
messages
when
os
functions
expecting
a
file
name
or
file
descriptor
receive
the
incorrect
type
.
...
...
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