summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index d457fd5489..419ecfaaaa 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1283,7 +1283,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
case BINARY_MODULO:
w = POP();
v = TOP();
- x = PyNumber_Remainder(v, w);
+ if (PyString_CheckExact(v))
+ x = PyString_Format(v, w);
+ else
+ x = PyNumber_Remainder(v, w);
Py_DECREF(v);
Py_DECREF(w);
SET_TOP(x);