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
5621ab85
Commit
5621ab85
authored
May 16, 2022
by
Ralf W. Grosse-Kunstleve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do we have a unit test for the traceback code in error_string()?
parent
ad146b2a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
40 deletions
+0
-40
include/pybind11/detail/type_caster_base.h
+0
-40
No files found.
include/pybind11/detail/type_caster_base.h
View file @
5621ab85
...
...
@@ -493,46 +493,6 @@ PYBIND11_NOINLINE std::string error_string() {
PyException_SetTraceback
(
scope
.
value
,
scope
.
trace
);
}
#if !defined(PYPY_VERSION)
if
(
scope
.
trace
)
{
auto
*
trace
=
(
PyTracebackObject
*
)
scope
.
trace
;
/* Get the deepest trace possible */
while
(
trace
->
tb_next
)
{
trace
=
trace
->
tb_next
;
}
PyFrameObject
*
frame
=
trace
->
tb_frame
;
Py_XINCREF
(
frame
);
errorString
+=
"
\n\n
At:
\n
"
;
while
(
frame
)
{
# if PY_VERSION_HEX >= 0x030900B1
PyCodeObject
*
f_code
=
PyFrame_GetCode
(
frame
);
# else
PyCodeObject
*
f_code
=
frame
->
f_code
;
Py_INCREF
(
f_code
);
# endif
int
lineno
=
PyFrame_GetLineNumber
(
frame
);
errorString
+=
" "
;
errorString
+=
handle
(
f_code
->
co_filename
).
cast
<
std
::
string
>
();
errorString
+=
'('
;
errorString
+=
std
::
to_string
(
lineno
);
errorString
+=
"): "
;
errorString
+=
handle
(
f_code
->
co_name
).
cast
<
std
::
string
>
();
errorString
+=
'\n'
;
Py_DECREF
(
f_code
);
# if PY_VERSION_HEX >= 0x030900B1
auto
*
b_frame
=
PyFrame_GetBack
(
frame
);
# else
auto
*
b_frame
=
frame
->
f_back
;
Py_XINCREF
(
b_frame
);
# endif
Py_DECREF
(
frame
);
frame
=
b_frame
;
}
}
#endif
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