Merge pull request #681 from nagisa/fix-docs
Fix docs on how to obtain object from PyErr
This commit is contained in:
commit
ac703f58a6
13
src/err.rs
13
src/err.rs
|
@ -19,9 +19,9 @@ use std::os::raw::c_char;
|
||||||
///
|
///
|
||||||
/// **CAUTION**
|
/// **CAUTION**
|
||||||
///
|
///
|
||||||
/// When you construct an instance of `PyErrValue`, we highly recommend to use `from_err_args` method.
|
/// When you construct an instance of `PyErrValue`, we highly recommend to use `from_err_args`
|
||||||
/// If you want to to construct `PyErrValue::ToArgs` directly, please do not forget calling
|
/// method. If you want to to construct `PyErrValue::ToArgs` directly, please do not forget to
|
||||||
/// `Python::acquire_gil`.
|
/// call `Python::acquire_gil`.
|
||||||
pub enum PyErrValue {
|
pub enum PyErrValue {
|
||||||
None,
|
None,
|
||||||
Value(PyObject),
|
Value(PyObject),
|
||||||
|
@ -43,10 +43,9 @@ pub struct PyErr {
|
||||||
|
|
||||||
/// The value of the exception.
|
/// The value of the exception.
|
||||||
///
|
///
|
||||||
/// This can be either an instance of `PyObject`,
|
/// This can be either an instance of `PyObject`, a tuple of arguments to be passed to
|
||||||
/// a tuple of arguments to be passed to `ptype`'s constructor,
|
/// `ptype`'s constructor, or a single argument to be passed to `ptype`'s constructor. Call
|
||||||
/// or a single argument to be passed to `ptype`'s constructor.
|
/// `PyErr::to_object()` to get the exception instance in all cases.
|
||||||
/// Call `PyErr::instance()` to get the exception instance in all cases.
|
|
||||||
pub pvalue: PyErrValue,
|
pub pvalue: PyErrValue,
|
||||||
|
|
||||||
/// The `PyTraceBack` object associated with the error.
|
/// The `PyTraceBack` object associated with the error.
|
||||||
|
|
Loading…
Reference in New Issue