diff options
| author | fanquake <[email protected]> | 2020-06-17 17:05:06 +0800 |
|---|---|---|
| committer | fanquake <[email protected]> | 2020-06-17 17:05:15 +0800 |
| commit | 09da0e46bf83e6d17ee55a9e669914423373e527 (patch) | |
| tree | 33ef951fcc5b1bc85983bd12cf3cb7bea9dff409 | |
| parent | Merge #19299: refactor: Remove unused vars, Add missing includes (diff) | |
| parent | contrib: Fix SyntaxWarning in Python base58 implementation (diff) | |
| download | discoin-09da0e46bf83e6d17ee55a9e669914423373e527.tar.xz discoin-09da0e46bf83e6d17ee55a9e669914423373e527.zip | |
Merge #19287: contrib: Fix SyntaxWarning in Python base58 implementation
47b49a05eafddcaef373f70436d794e9f9f7495c contrib: Fix SyntaxWarning in Python base58 implementation (Alex Willmer)
Pull request description:
In Python integers should be compared for equality (`i == j`), not identity (`i is j`). Recent versions of CPython 3.x emit a SyntaxWarning when they encounter this incorrect usage, e.g.
```
$ python3 base58.py
base58.py:110: SyntaxWarning: "is" with a literal. Did you mean "=="?
assert get_bcaddress_version('15VjRaDX9zpbA8LVnbrCAFzrVzN7ixHNsC') is 0
Tests passed
```
ACKs for top commit:
MarcoFalke:
ACK 47b49a05eafddcaef373f70436d794e9f9f7495c
Tree-SHA512: 9f8962025dcdfa062c0515c68a1864f5bbeb86bd0510c0ec0e413a5edb6afbfd5f41b4c0255784e53db8eaf39c68b7cfa7cc8a33a2e5214aae463fda374f8719
| -rw-r--r-- | contrib/testgen/base58.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/testgen/base58.py b/contrib/testgen/base58.py index da67cb2d9..c7ebac50d 100644 --- a/contrib/testgen/base58.py +++ b/contrib/testgen/base58.py @@ -107,7 +107,7 @@ def get_bcaddress_version(strAddress): if __name__ == '__main__': # Test case (from http://gitorious.org/bitcoin/python-base58.git) - assert get_bcaddress_version('15VjRaDX9zpbA8LVnbrCAFzrVzN7ixHNsC') is 0 + assert get_bcaddress_version('15VjRaDX9zpbA8LVnbrCAFzrVzN7ixHNsC') == 0 _ohai = 'o hai'.encode('ascii') _tmp = b58encode(_ohai) assert _tmp == 'DYB3oMS' |