Merge pull request #681 from nagisa/fix-docs

Fix docs on how to obtain object from PyErr
This commit is contained in:
Yuji Kanagawa 2019-12-05 11:19:58 +09:00 committed by GitHub
commit ac703f58a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 7 deletions

View File

@ -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.