-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
Issue with Python 3.2 #41
Comments
indeed ☺ I was actually thinking of doing a PR anyway, just wanted to understand the .so issue in the other ticket first, though ☺ |
actually, a good fix could be:
though it's always nicer to avoid using introspection builtins like |
Go ahead if you want to make a PR :-) I prefer: try:
FileNotFoundError = FileNotFoundError
except NameError:
FileNotFoundError = IOError to be honest. It seems more explicit. |
guyzmo
added a commit
to guyzmo/pendulum
that referenced
this issue
Sep 5, 2016
The `IOError` refactoring has been introduced by PEP-3151 which has been implemented in Python 3.3+. This patch fixes the bug by having `FileNotFoundError` assigned as `IOError` on ≤3.2 pythons. * fixes issue sdispater#41 Signed-off-by: Bernard `Guyzmo` Pratz <guyzmo+github+pub@m0g.net>
sdispater
pushed a commit
that referenced
this issue
Sep 5, 2016
The `IOError` refactoring has been introduced by PEP-3151 which has been implemented in Python 3.3+. This patch fixes the bug by having `FileNotFoundError` assigned as `IOError` on ≤3.2 pythons. * fixes issue #41 Signed-off-by: Bernard `Guyzmo` Pratz <guyzmo+github+pub@m0g.net>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I installed pendulum on Python 3.2 install, and when I run it, here's what I get:
It looks like the
FileNotFoundError
exception, along with the rework of the OS/IO exceptions has been introduced in Python 3.3.cf
I do not understand why
FileNotFoundError
could not defined in Python 3.2. cf PEP-3151Instead of relying on major python versions to check for features, I'd suggest to check for the feature and fallback to the alternative. Such as:
The Python3.2.3 I'm using, is the one from Debian Wheezy (old-stable) and I installed pendulum v0.5.5 from Pypi. I tried with the suggested fix above, and it works.
The text was updated successfully, but these errors were encountered: