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
fbec17ce
Commit
fbec17ce
authored
Nov 24, 2016
by
Wenzel Jakob
Browse files
error_already_set: move-only semantics
parent
2ac2d694
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
include/pybind11/common.h
include/pybind11/common.h
+7
-0
No files found.
include/pybind11/common.h
View file @
fbec17ce
...
@@ -475,6 +475,13 @@ public:
...
@@ -475,6 +475,13 @@ public:
error_already_set
()
:
std
::
runtime_error
(
detail
::
error_string
())
{
error_already_set
()
:
std
::
runtime_error
(
detail
::
error_string
())
{
PyErr_Fetch
(
&
type
,
&
value
,
&
trace
);
PyErr_Fetch
(
&
type
,
&
value
,
&
trace
);
}
}
error_already_set
(
const
error_already_set
&
)
=
delete
;
error_already_set
(
error_already_set
&&
e
)
:
std
::
runtime_error
(
e
.
what
()),
type
(
e
.
type
),
value
(
e
.
value
),
trace
(
e
.
trace
)
{
e
.
type
=
e
.
value
=
e
.
trace
=
nullptr
;
}
~
error_already_set
()
{
Py_XDECREF
(
type
);
Py_XDECREF
(
value
);
Py_XDECREF
(
trace
);
}
~
error_already_set
()
{
Py_XDECREF
(
type
);
Py_XDECREF
(
value
);
Py_XDECREF
(
trace
);
}
/// Give the error back to Python
/// Give the error back to Python
...
...
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