Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
8d396fcf
Commit
8d396fcf
authored
Nov 24, 2016
by
Wenzel Jakob
Browse files
use pybind11::gil_scoped_acquire instead of PyGILState_*
parent
099d6e9c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
include/pybind11/common.h
include/pybind11/common.h
+1
-8
include/pybind11/pybind11.h
include/pybind11/pybind11.h
+8
-0
No files found.
include/pybind11/common.h
View file @
8d396fcf
...
...
@@ -482,14 +482,7 @@ public:
:
std
::
runtime_error
(
e
.
what
()),
type
(
e
.
type
),
value
(
e
.
value
),
trace
(
e
.
trace
)
{
e
.
type
=
e
.
value
=
e
.
trace
=
nullptr
;
}
~
error_already_set
()
{
if
(
value
)
{
PyGILState_STATE
state
=
PyGILState_Ensure
();
PyErr_Restore
(
type
,
value
,
trace
);
PyErr_Clear
();
PyGILState_Release
(
state
);
}
}
inline
~
error_already_set
();
// implementation in pybind11.h
error_already_set
&
operator
=
(
const
error_already_set
&
)
=
delete
;
...
...
include/pybind11/pybind11.h
View file @
8d396fcf
...
...
@@ -1647,6 +1647,14 @@ class gil_scoped_acquire { };
class
gil_scoped_release
{
};
#endif
error_already_set
::~
error_already_set
()
{
if
(
value
)
{
gil_scoped_acquire
gil
;
PyErr_Restore
(
type
,
value
,
trace
);
PyErr_Clear
();
}
}
inline
function
get_type_overload
(
const
void
*
this_ptr
,
const
detail
::
type_info
*
this_type
,
const
char
*
name
)
{
handle
py_object
=
detail
::
get_object_handle
(
this_ptr
,
this_type
);
if
(
!
py_object
)
...
...
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