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
8d396fcf
Commit
8d396fcf
authored
Nov 24, 2016
by
Wenzel Jakob
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use pybind11::gil_scoped_acquire instead of PyGILState_*
parent
099d6e9c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
include/pybind11/common.h
+1
-8
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