Skip to content

Commit 173e860

Browse files
committed
add version magic to python2 compat fix in rpc.py
1 parent 98ecbc6 commit 173e860

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

bitcoin/rpc.py

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

45-
try:
46-
FileNotFoundError
47-
except NameError:
48-
FileNotFoundError = IOError
45+
# needed for python2 compatibility
46+
if sys.version < '3':
47+
try:
48+
FileNotFoundError
49+
except NameError:
50+
FileNotFoundError = IOError
4951

5052
import bitcoin
5153
from bitcoin.core import COIN, x, lx, b2lx, CBlock, CBlockHeader, CTransaction, COutPoint, CTxOut

0 commit comments

Comments
 (0)