Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Boxiang Sun
Pyston
Commits
c2f81a09
Commit
c2f81a09
authored
Apr 11, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
raise0_capi
parent
f78c923d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
9 deletions
+8
-9
src/runtime/exceptions.cpp
src/runtime/exceptions.cpp
+8
-7
test/tests/sys_excinfo.py
test/tests/sys_excinfo.py
+0
-1
test/tests/traceback_test.py
test/tests/traceback_test.py
+0
-1
No files found.
src/runtime/exceptions.cpp
View file @
c2f81a09
...
...
@@ -176,21 +176,22 @@ extern "C" void raise0(ExcInfo* frame_exc_info) {
}
extern
"C"
void
raise0_capi
(
ExcInfo
*
frame_exc_info
)
noexcept
{
assert
(
0
&&
"check refcounting"
);
updateFrameExcInfoIfNeeded
(
frame_exc_info
);
assert
(
frame_exc_info
->
type
);
// TODO need to clean up when we call normalize, do_raise, etc
if
(
frame_exc_info
->
type
==
None
)
{
assert
(
0
&&
"check refcounting"
);
frame_exc_info
->
type
=
TypeError
;
frame_exc_info
->
value
=
boxString
(
"exceptions must be old-style classes or derived from BaseException, not NoneType"
);
frame_exc_info
->
traceback
=
NULL
;
PyErr_NormalizeException
(
&
frame_exc_info
->
type
,
&
frame_exc_info
->
value
,
&
frame_exc_info
->
traceback
);
PyErr_SetString
(
TypeError
,
"exceptions must be old-style classes or derived from BaseException, not NoneType"
);
return
;
}
startReraise
();
assert
(
!
PyErr_Occurred
());
Py_INCREF
(
frame_exc_info
->
type
);
Py_INCREF
(
frame_exc_info
->
value
);
Py_INCREF
(
frame_exc_info
->
traceback
);
PyErr_Restore
(
frame_exc_info
->
type
,
frame_exc_info
->
value
,
frame_exc_info
->
traceback
);
}
...
...
test/tests/sys_excinfo.py
View file @
c2f81a09
# expected: reffail
# should_error
# Different ways of nesting exceptions
...
...
test/tests/traceback_test.py
View file @
c2f81a09
# expected: reffail
# A test of both the tracebacks we generate and the traceback module
#
# (We keep fixing tracebacks in one case to break them in another, so it's time for a test.)
...
...
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