-
Notifications
You must be signed in to change notification settings - Fork 36.2k
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
tests: Handle ImportError explicitly, improve comparisons against None #14903
Conversation
meh ACK |
ACK 1b89074 I think we should use
|
Will do - thanks, @practicalswift! |
@daniel-s-ingram Great! When doing that don't forget to enable And don't forget the technical rationale in the PR description: otherwise people who aren't familiar with how Python handles |
utACK c9ba253 |
Agree. This is overall an improvement, IMO. I did change the PR title to be more comprehensible and in line with the actual changes. utACK c9ba253 |
…ns against None c9ba253 Add E711 to flake8 check (Daniel Ingram) 17b5520 Compare to None with is/is not (Daniel Ingram) 1b89074 Change '== None' to 'is None' (Daniel Ingram) 16d2937 Handle exception as ImportError (Daniel Ingram) Pull request description: Tree-SHA512: aa5875ea3d9ac47ac898545ff023b511042cd377ea0c4594074daae119f3d4f3fc295721aad94a732a907086ecb32bce19a8eed38adf479f12663c4e8944f721
@@ -25,7 +25,7 @@ | |||
import codecs | |||
try: | |||
from urllib.request import Request,urlopen | |||
except: | |||
except ImportError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This exception handling is a vestige from when github-merge.py supported Python 2 and Python 3. We only support Python 3 now so we should be able to remove it entirely and just import from urllib.request
.
4de11a3 Remove Python 2 import workarounds (practicalswift) Pull request description: Remove Python 2 import workarounds. As noted by @jnewbery in #14903 (comment): > This exception handling is a vestige from when github-merge.py supported Python 2 and Python 3. We only support Python 3 now so we should be able to remove it entirely and just import from urllib.request. Tree-SHA512: e0d21e6299dd62fb669ad95cbd3d19f7c803195fd336621aac72fd10ddc7431d90443831072a2e1eb2fc880d1d88eb7c3e2ead3da59f545f6db07d349af98fb3
4de11a3 Remove Python 2 import workarounds (practicalswift) Pull request description: Remove Python 2 import workarounds. As noted by @jnewbery in bitcoin#14903 (comment): > This exception handling is a vestige from when github-merge.py supported Python 2 and Python 3. We only support Python 3 now so we should be able to remove it entirely and just import from urllib.request. Tree-SHA512: e0d21e6299dd62fb669ad95cbd3d19f7c803195fd336621aac72fd10ddc7431d90443831072a2e1eb2fc880d1d88eb7c3e2ead3da59f545f6db07d349af98fb3
4de11a3 Remove Python 2 import workarounds (practicalswift) Pull request description: Remove Python 2 import workarounds. As noted by @jnewbery in bitcoin#14903 (comment): > This exception handling is a vestige from when github-merge.py supported Python 2 and Python 3. We only support Python 3 now so we should be able to remove it entirely and just import from urllib.request. Tree-SHA512: e0d21e6299dd62fb669ad95cbd3d19f7c803195fd336621aac72fd10ddc7431d90443831072a2e1eb2fc880d1d88eb7c3e2ead3da59f545f6db07d349af98fb3
4de11a3 Remove Python 2 import workarounds (practicalswift) Pull request description: Remove Python 2 import workarounds. As noted by @jnewbery in bitcoin#14903 (comment): > This exception handling is a vestige from when github-merge.py supported Python 2 and Python 3. We only support Python 3 now so we should be able to remove it entirely and just import from urllib.request. Tree-SHA512: e0d21e6299dd62fb669ad95cbd3d19f7c803195fd336621aac72fd10ddc7431d90443831072a2e1eb2fc880d1d88eb7c3e2ead3da59f545f6db07d349af98fb3
…mparisons against None c9ba253 Add E711 to flake8 check (Daniel Ingram) 17b5520 Compare to None with is/is not (Daniel Ingram) 1b89074 Change '== None' to 'is None' (Daniel Ingram) 16d2937 Handle exception as ImportError (Daniel Ingram) Pull request description: Tree-SHA512: aa5875ea3d9ac47ac898545ff023b511042cd377ea0c4594074daae119f3d4f3fc295721aad94a732a907086ecb32bce19a8eed38adf479f12663c4e8944f721
…mparisons against None c9ba253 Add E711 to flake8 check (Daniel Ingram) 17b5520 Compare to None with is/is not (Daniel Ingram) 1b89074 Change '== None' to 'is None' (Daniel Ingram) 16d2937 Handle exception as ImportError (Daniel Ingram) Pull request description: Tree-SHA512: aa5875ea3d9ac47ac898545ff023b511042cd377ea0c4594074daae119f3d4f3fc295721aad94a732a907086ecb32bce19a8eed38adf479f12663c4e8944f721
No description provided.