[pypy-svn] r77358 - pypy/branch/fast-forward/lib-python/2.7.0
afa at codespeak.net
afa at codespeak.net
Fri Sep 24 22:23:38 CEST 2010
Author: afa
Date: Fri Sep 24 22:23:35 2010
New Revision: 77358
Modified:
pypy/branch/fast-forward/lib-python/2.7.0/urllib.py
Log:
Change to a much simpler code that does not require 'bytearray'
(which is not yet available in pypy.)
Yes, I'm modifying the original copy of urllib.py, for two reasons:
- It's a cosmetic change that will not be backported to CPython
- It will be discarded when we import a new revision of the 2.7 stdlib,
but at this time we will have a working bytearray and we will forget
all this.
Modified: pypy/branch/fast-forward/lib-python/2.7.0/urllib.py
==============================================================================
--- pypy/branch/fast-forward/lib-python/2.7.0/urllib.py (original)
+++ pypy/branch/fast-forward/lib-python/2.7.0/urllib.py Fri Sep 24 22:23:35 2010
@@ -1189,7 +1189,8 @@
'abcdefghijklmnopqrstuvwxyz'
'0123456789' '_.-')
_safe_map = {}
-for i, c in zip(xrange(256), str(bytearray(xrange(256)))):
+for i in xrange(256):
+ c = chr(i)
_safe_map[c] = c if (i < 128 and c in always_safe) else '%{:02X}'.format(i)
_safe_quoters = {}
More information about the Pypy-commit
mailing list