diff options
author | Guido van Rossum <guido@python.org> | 1996-01-26 17:41:44 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-01-26 17:41:44 (GMT) |
commit | 8c8a02a2588b0219d88fb892635148f9467f6634 (patch) | |
tree | 326503eefb97f43fd313226f6035aa2a83629eb2 | |
parent | 44a4d59b566a13d2054444a550866c9c5187571d (diff) | |
download | cpython-8c8a02a2588b0219d88fb892635148f9467f6634.zip cpython-8c8a02a2588b0219d88fb892635148f9467f6634.tar.gz cpython-8c8a02a2588b0219d88fb892635148f9467f6634.tar.bz2 |
speed up unquote() by using atoi() instead of eval()
-rw-r--r-- | Lib/urllib.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py index a0ecaac..dc2d2cf 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 |