No description provided.
tests: Handle ImportError explicitly, improve comparisons against None #14903
pull daniel-s-ingram wants to merge 4 commits into bitcoin:master from daniel-s-ingram:master changing 9 files +18 −17-
daniel-s-ingram commented at 8:50 PM on December 9, 2018: contributor
-
Handle exception as ImportError 16d2937723
-
Change '== None' to 'is None' 1b89074ae2
- fanquake added the label Scripts and tools on Dec 9, 2018
-
jonasschnelli commented at 11:00 PM on December 9, 2018: contributor
meh ACK
-
practicalswift commented at 7:27 PM on December 10, 2018: contributor
ACK 1b89074ae27ce123adbeed57343deaef13c14f81
I think we should use
is None/is not Noneinstead of== None/!= Nonethroughout the code base. The former is safer and faster. Feel free to open such a PR :-)git grep -E '(!=|==) *None' -- "*.py"is your friend. -
daniel-s-ingram commented at 7:33 PM on December 10, 2018: contributor
Will do - thanks, @practicalswift!
-
practicalswift commented at 7:41 PM on December 10, 2018: contributor
@daniel-s-ingram Great! When doing that don't forget to enable
flake8checkE711intest/lint/lint-python.shto make sure your fix becomes permanent until the end of time :-)And don't forget the technical rationale in the PR description: otherwise people who aren't familiar with how Python handles
isvs==will incorrectly claim your fix is cosmetic :-) -
Compare to None with is/is not 17b55202da
-
Add E711 to flake8 check c9ba253f4f
-
practicalswift commented at 8:26 PM on December 10, 2018: contributor
utACK c9ba253f4f5d675d7736d24c1167229d0898ef1a
- laanwj renamed this:
Handle exception as ImportError
tests: Handle ImportError explicitly
on Dec 13, 2018 - laanwj renamed this:
tests: Handle ImportError explicitly
tests: Handle ImportError explicitly, improve comparisons against None
on Dec 13, 2018 -
laanwj commented at 11:58 AM on December 13, 2018: member
I think we should use is None/is not None instead of == None/!= None throughout the code base. The former is safer and faster. Feel free to open such a PR :-)
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 c9ba253f4f5d675d7736d24c1167229d0898ef1a
- laanwj merged this on Dec 13, 2018
- laanwj closed this on Dec 13, 2018
- laanwj referenced this in commit f17aca67b0 on Dec 13, 2018
-
in contrib/devtools/github-merge.py:28 in c9ba253f4f
24 | @@ -25,7 +25,7 @@ 25 | import codecs 26 | try: 27 | from urllib.request import Request,urlopen 28 | -except: 29 | +except ImportError:
jnewbery commented at 1:23 PM on December 13, 2018: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.MarcoFalke referenced this in commit 9a43344430 on Dec 13, 2018pravblockc referenced this in commit 9dd702cd5a on Aug 2, 2021pravblockc referenced this in commit a41ca898dc on Aug 3, 2021pravblockc referenced this in commit a309982e82 on Aug 3, 2021Munkybooty referenced this in commit 5edce02d5f on Aug 5, 2021Munkybooty referenced this in commit 7e64c688fe on Aug 5, 2021MarcoFalke locked this on Sep 8, 2021
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-16 18:14 UTC
More mirrored repositories can be found on mirror.b10c.me