From: Guido van Rossum Date: Fri, 26 Jan 1996 17:41:44 +0000 (+0000) Subject: speed up unquote() by using atoi() instead of eval() X-Git-Tag: v1.4b1~381 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c8a02a2588b0219d88fb892635148f9467f6634;p=python speed up unquote() by using atoi() instead of eval() --- diff --git a/Lib/urllib.py b/Lib/urllib.py index a0ecaac884..dc2d2cf619 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -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