Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address Python 2/3’s different Exception hierarchies #7

Closed
benjaminp opened this issue Mar 16, 2012 · 3 comments
Closed

Address Python 2/3’s different Exception hierarchies #7

benjaminp opened this issue Mar 16, 2012 · 3 comments

Comments

@benjaminp
Copy link
Owner

Originally reported by: Zearin (Bitbucket: Zearin, GitHub: Zearin)


There are a few differences in the Exception hierarchies between Python 2 and 3.

(//Aside: Both Pythons allow you to interact with Exceptions without importing anything, but Python 2 also has an importable exceptions module. Dunno why.//)

Could six provide a few mappings to address these differences?


@benjaminp
Copy link
Owner Author

What specifically were you thinking about?

@benjaminp
Copy link
Owner Author

Original comment by Zearin (Bitbucket: Zearin, GitHub: Zearin):


…! Wow.

I am embarrassed. I just put the exception hierarchies together side-by-side, and there are in fact very, very few differences. For whatever reason, I thought there were more. Kinda makes me feel silly, as it’s probably not worth opening an enhancement request.


Well, since I foolishly did exactly that—and we’re both reading this—here are the only differences I can spot:

  • (Py2) StandardError → (Py3) Exception
  • OSError(EnvironmentError) got 2 new subclasses in Py3: WindowsError and VMSError
  • Warning got a new subclass in Py3: ResourceWarning

So, yeah. I’m dumb. Only the first of those items is a conversion, and I guess that’s not really a big deal anyway.

Sorry. :-/

@benjaminp
Copy link
Owner Author

Okay, then. :)

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

No branches or pull requests

1 participant