raise Exception(...)
This commit is contained in:
parent
7695a9c015
commit
1e3d2d24bb
2 changed files with 5 additions and 5 deletions
|
@ -81,9 +81,9 @@ def bdecode(x, sloppy = 1):
|
||||||
r, l = decode_func[x[0]](x, 0)
|
r, l = decode_func[x[0]](x, 0)
|
||||||
# except (IndexError, KeyError):
|
# except (IndexError, KeyError):
|
||||||
except (IndexError, KeyError, ValueError):
|
except (IndexError, KeyError, ValueError):
|
||||||
raise ValueError, "bad bencoded data"
|
raise ValueError("bad bencoded data")
|
||||||
if not sloppy and l != len(x):
|
if not sloppy and l != len(x):
|
||||||
raise ValueError, "bad bencoded data"
|
raise ValueError("bad bencoded data")
|
||||||
return r
|
return r
|
||||||
|
|
||||||
def test_bdecode():
|
def test_bdecode():
|
||||||
|
|
|
@ -17,7 +17,7 @@ def get(key):
|
||||||
if key in auth:
|
if key in auth:
|
||||||
return auth[key]
|
return auth[key]
|
||||||
print("please add key %s to json file '%s'" % (key, user_auth))
|
print("please add key %s to json file '%s'" % (key, user_auth))
|
||||||
raise Exception,"no key %s found" % key
|
raise Exception("no key %s found" % key)
|
||||||
|
|
||||||
def update(key, value):
|
def update(key, value):
|
||||||
user_auth = os.environ.get('oxAUTH', os.path.expanduser('~/.ox/auth.json'))
|
user_auth = os.environ.get('oxAUTH', os.path.expanduser('~/.ox/auth.json'))
|
||||||
|
|
Loading…
Add table
Reference in a new issue