mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 23:09:44 -04:00
contrib: Fix SyntaxWarning in Python base58 implementation
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 ```
This commit is contained in:
parent
1c86ed4148
commit
47b49a05ea
1 changed files with 1 additions and 1 deletions
|
@ -107,7 +107,7 @@ def get_bcaddress_version(strAddress):
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# Test case (from http://gitorious.org/bitcoin/python-base58.git)
|
# 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')
|
_ohai = 'o hai'.encode('ascii')
|
||||||
_tmp = b58encode(_ohai)
|
_tmp = b58encode(_ohai)
|
||||||
assert _tmp == 'DYB3oMS'
|
assert _tmp == 'DYB3oMS'
|
||||||
|
|
Loading…
Add table
Reference in a new issue