summaryrefslogtreecommitdiff
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-02-26 18:55:48 +0000
committerBenjamin Peterson <benjamin@python.org>2009-02-26 18:55:48 +0000
commit6d5cd4034ea3ac05b51d6c12ba31e068349c8d30 (patch)
treeacba9768889171532861b683c0cddae268012dc0 /Python/ceval.c
parent3fb79b3bf55e6541f9322fabd6e4a38749fc00eb (diff)
downloadcpython-6d5cd4034ea3ac05b51d6c12ba31e068349c8d30.tar.gz
Merged revisions 69811,69947 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r69811 | collin.winter | 2009-02-20 13:30:41 -0600 (Fri, 20 Feb 2009) | 2 lines Issue 5176: special-case string formatting in BINARY_MODULO implementation. This shows a modest (1-3%) speed-up in templating systems, for example. ........ r69947 | jeffrey.yasskin | 2009-02-24 16:48:34 -0600 (Tue, 24 Feb 2009) | 3 lines Tools/scripts/analyze_dxp.py, a module with some helper functions to analyze the output of sys.getdxp(). ........
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index d1d6d1d849..e693147c2a 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1446,7 +1446,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
TARGET(BINARY_MODULO)
w = POP();
v = TOP();
- x = PyNumber_Remainder(v, w);
+ if (PyUnicode_CheckExact(v))
+ x = PyUnicode_Format(v, w);
+ else
+ x = PyNumber_Remainder(v, w);
Py_DECREF(v);
Py_DECREF(w);
SET_TOP(x);