Skip to content

Conversation

@asoderman
Copy link

This allows for more flexibility for converting between error types.

Relevant issue: #125

Copy link
Contributor

@Eijebong Eijebong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should remove that err.rs.swp

src/err.rs Outdated
}

impl Error for PyErr {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✂️

src/err.rs Outdated
}

impl fmt::Display for PyErr {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✂️

@asoderman
Copy link
Author

Fixed

@Ploppz
Copy link

Ploppz commented Apr 3, 2018

Waiting for this to be merged. Is it because Travis failed? Seems like it cannot compile some test - but this seems to not be caused by this PR (?)

@asoderman
Copy link
Author

I sync'd my branch with master and it appears to have fixed the error with the doctest however there is a new error with nightly. Not really sure what is causing it.


impl fmt::Display for PyErr {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "PyErr: ptype {:?} pvalue {:?}", self.ptype, self.pvalue)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect Display to result in something like str(e) in Python.
This code here is more like repr(type(e)) + repr(e), except even weirder if the exception is not yet initialized (PyErr::new_lazy_init).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants