Author: Armin Rigo <[email protected]>
Branch: py3k
Changeset: r86768:60119aad4cd8
Date: 2016-08-31 10:45 +0200
http://bitbucket.org/pypy/pypy/changeset/60119aad4cd8/
Log: Move this loop out of the way of the JIT
diff --git a/pypy/objspace/std/unicodeobject.py
b/pypy/objspace/std/unicodeobject.py
--- a/pypy/objspace/std/unicodeobject.py
+++ b/pypy/objspace/std/unicodeobject.py
@@ -375,16 +375,19 @@
raise
return space.newbool(res)
+ def _parse_format_arg(self, space, w_kwds, __args__):
+ for i in range(len(__args__.keywords)):
+ try: # pff
+ arg = __args__.keywords[i].decode('utf-8')
+ except UnicodeDecodeError:
+ continue # uh, just skip that
+ space.setitem(w_kwds, space.newunicode(arg),
+ __args__.keywords_w[i])
+
def descr_format(self, space, __args__):
w_kwds = space.newdict()
if __args__.keywords:
- for i in range(len(__args__.keywords)):
- try: # pff
- arg = __args__.keywords[i].decode('utf-8')
- except UnicodeDecodeError:
- continue # uh, just skip that
- space.setitem(w_kwds, space.newunicode(arg),
- __args__.keywords_w[i])
+ self._parse_format_arg(space, w_kwds, __args__)
return newformat.format_method(space, self, __args__.arguments_w,
w_kwds, True)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit