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().
........
diff --git a/Python/ceval.c b/Python/ceval.c
index d1d6d1d..e693147 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1446,7 +1446,10 @@
 		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);