mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-05 16:08: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
ffb8d9f8c3
commit
bcc7a74725
1 changed files with 5 additions and 1 deletions
|
@ -61,7 +61,11 @@ def atom(next, token):
|
||||||
if token[1] == "-":
|
if token[1] == "-":
|
||||||
return int(token[-1], 0)
|
return int(token[-1], 0)
|
||||||
else:
|
else:
|
||||||
return int(token[1], 0)
|
if token[1].startswith('0x'):
|
||||||
|
# Hex number so return unconverted as string.
|
||||||
|
return token[1].decode("string-escape")
|
||||||
|
else:
|
||||||
|
return int(token[1], 0)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
try:
|
try:
|
||||||
return float(token[-1])
|
return float(token[-1])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue