Author: Antonio Cuni <anto.c...@gmail.com> Branch: py3k Changeset: r56542:5226ba3dc28d Date: 2012-08-02 18:56 +0200 http://bitbucket.org/pypy/pypy/changeset/5226ba3dc28d/
Log: bah, there are two levels of memo/cache, and we need to specialize for unicode formatting strings on both levels diff --git a/pypy/interpreter/error.py b/pypy/interpreter/error.py --- a/pypy/interpreter/error.py +++ b/pypy/interpreter/error.py @@ -361,10 +361,12 @@ return OpErrFmt, strings def get_operationerr_class(valuefmt): + is_unicode = isinstance(valuefmt, unicode) + key = (is_unicode, valuefmt) try: - result = _fmtcache[valuefmt] + result = _fmtcache[key] except KeyError: - result = _fmtcache[valuefmt] = get_operrcls2(valuefmt) + result = _fmtcache[key] = get_operrcls2(valuefmt) return result get_operationerr_class._annspecialcase_ = 'specialize:memo' _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit