Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
6969e7c1
Commit
6969e7c1
authored
Jul 18, 2016
by
Wenzel Jakob
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exception handler tweaks (fixes #284)
parent
d46b6eee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
include/pybind11/cast.h
+8
-8
No files found.
include/pybind11/cast.h
View file @
6969e7c1
...
@@ -104,18 +104,18 @@ PYBIND11_NOINLINE inline handle get_type_handle(const std::type_info &tp) {
...
@@ -104,18 +104,18 @@ PYBIND11_NOINLINE inline handle get_type_handle(const std::type_info &tp) {
}
}
PYBIND11_NOINLINE
inline
std
::
string
error_string
()
{
PYBIND11_NOINLINE
inline
std
::
string
error_string
()
{
std
::
string
errorString
;
PyObject
*
type
,
*
value
,
*
traceback
;
PyThreadState
*
tstate
=
PyThreadState_GET
();
PyErr_Fetch
(
&
type
,
&
value
,
&
traceback
);
if
(
tstate
==
nullptr
)
return
""
;
if
(
tstate
->
curexc_type
)
{
std
::
string
errorString
;
errorString
+=
(
std
::
string
)
handle
(
tstate
->
curexc_type
).
str
();
if
(
type
)
{
errorString
+=
(
std
::
string
)
handle
(
type
).
str
();
errorString
+=
": "
;
errorString
+=
": "
;
}
}
if
(
tstate
->
curexc_
value
)
if
(
value
)
errorString
+=
(
std
::
string
)
handle
(
tstate
->
curexc_
value
).
str
();
errorString
+=
(
std
::
string
)
handle
(
value
).
str
();
PyErr_Restore
(
type
,
value
,
traceback
);
return
errorString
;
return
errorString
;
}
}
...
...
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