Skip to content

Commit 607aa99

Browse files
committed
Merge #207: Fix python 27 incompatibility by defining FileNotFoundError
173e860 add version magic to python2 compat fix in rpc.py (Florian) 98ecbc6 work around a python 27 incompatibility by defining FileNotFoundError (Florian) Pull request description: This small pul requests fixes a compatibility with python27 by by defining FileNotFoundError. Tree-SHA512: c0e32a1be986f1bb4c4ebfa3b06d0e50f2e442f2b06f16b66e681838b39b69e562d5cee6019b2cfd606b42260efb1cf0ba6fe0b9d8f531f60e46dc512ce1b49d
2 parents 286e7d7 + 173e860 commit 607aa99

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

bitcoin/rpc.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@
4242
except ImportError:
4343
import urlparse
4444

45+
# needed for python2 compatibility
46+
if sys.version < '3':
47+
try:
48+
FileNotFoundError
49+
except NameError:
50+
FileNotFoundError = IOError
51+
4552
import bitcoin
4653
from bitcoin.core import COIN, x, lx, b2lx, CBlock, CBlockHeader, CTransaction, COutPoint, CTxOut
4754
from bitcoin.core.script import CScript

0 commit comments

Comments
 (0)