mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-16 21:36:40 +00:00
[#3112|Console] Fix handling hex for setting peer_tos in config
The token parser was converting hex value to int which is not what should be passed onto libtorrent peer_tos setting.
This commit is contained in:
parent
0ba87b424c
commit
507c5df984
@ -38,6 +38,10 @@ def atom(src, token):
|
|||||||
try:
|
try:
|
||||||
if token[1] == '-':
|
if token[1] == '-':
|
||||||
return int(token[-1], 0)
|
return int(token[-1], 0)
|
||||||
|
else:
|
||||||
|
if token[1].startswith('0x'):
|
||||||
|
# Hex number so return unconverted as string.
|
||||||
|
return token[1].decode('string-escape')
|
||||||
else:
|
else:
|
||||||
return int(token[1], 0)
|
return int(token[1], 0)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user