File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 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
1212
1313# Based on https://github.com/karamanolev/bencode3/blob/master/bencode.py
1414
15+ __version__ = ' 1.0.0'
16+
1517import sys
1618IS_PY2 = sys.version[0 ] == ' 2'
1719
@@ -77,13 +79,11 @@ for func, keys in [
7779 decode_func[ord (key)] = func
7880
7981
80-
8182def 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
You can’t perform that action at this time.
0 commit comments