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**
///
/// When you construct an instance of `PyErrValue`, we highly recommend to use `from_err_args` method.
/// If you want to to construct `PyErrValue::ToArgs` directly, please do not forget calling
/// `Python::acquire_gil`.
/// When you construct an instance of `PyErrValue`, we highly recommend to use `from_err_args`
/// method. If you want to to construct `PyErrValue::ToArgs` directly, please do not forget to
/// call `Python::acquire_gil`.
pub enum PyErrValue {
None,
Value(PyObject),
@ -43,10 +43,9 @@ pub struct PyErr {
/// The value of the exception.
///
/// This can be either an instance of `PyObject`,
/// a tuple of arguments to be passed to `ptype`'s constructor,
/// or a single argument to be passed to `ptype`'s constructor.
/// Call `PyErr::instance()` to get the exception instance in all cases.
/// This can be either an instance of `PyObject`, a tuple of arguments to be passed to
/// `ptype`'s constructor, or a single argument to be passed to `ptype`'s constructor. Call
/// `PyErr::to_object()` to get the exception instance in all cases.
pub pvalue: PyErrValue,
/// The `PyTraceBack` object associated with the error.