speed up unquote() by using atoi() instead of eval()

This commit is contained in:
Guido van Rossum 1996-01-26 17:41:44 +00:00
parent 44a4d59b56
commit 8c8a02a258
1 changed files with 1 additions and 1 deletions

View File

@ -645,7 +645,7 @@ def unquote(s):
if j < 0:
res = res + s[i:]
break
res = res + (s[i:j] + chr(eval('0x' + s[j+1:j+3])))
res = res + (s[i:j] + chr(string.atoi(s[j+1:j+3], 16)))
i = j+3
return res