Skip to content

Commit 26f0f84

Browse files
committed
Code style improvement
1 parent 682055e commit 26f0f84

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

bencoder.pyx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#cython: language_level=3
1+
# cython: language_level=3
22

33
# The contents of this file are subject to the BitTorrent Open Source License
44
# Version 1.1 (the License). You may not copy or use this file, in either
@@ -12,6 +12,8 @@
1212

1313
# Based on https://github.com/karamanolev/bencode3/blob/master/bencode.py
1414

15+
__version__ = '1.0.0'
16+
1517
import sys
1618
IS_PY2 = sys.version[0] == '2'
1719

@@ -77,13 +79,11 @@ for func, keys in [
7779
decode_func[ord(key)] = func
7880

7981

80-
8182
def bdecode(bytes x):
8283
try:
8384
r, l = decode_func[x[0]](x, 0)
84-
except (IndexError, KeyError, ValueError) as e:
85-
raise e
86-
# raise BTFailure("not a valid bencoded string")
85+
except (IndexError, KeyError, ValueError):
86+
raise BTFailure("not a valid bencoded string")
8787
if l != len(x):
8888
raise BTFailure("invalid bencoded value (data after valid prefix)")
8989
return r

0 commit comments

Comments
 (0)