[Python-checkins] cpython (3.2): time.strftime(): replace PyErr_Format() by PyErr_SetString()

victor.stinner python-checkins at python.org
Mon Mar 21 02:15:25 CET 2011


http://hg.python.org/cpython/rev/be74f446b4b8
changeset: 68783:be74f446b4b8
branch: 3.2
parent: 68781:d56eb817b181
user: Victor Stinner <victor.stinner at haypocalc.com>
date: Mon Mar 21 02:14:53 2011 +0100
summary:
 time.strftime(): replace PyErr_Format() by PyErr_SetString()
The argument was not used in the format string.
files:
 Modules/timemodule.c
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -476,9 +476,8 @@
 
 #if defined(_MSC_VER) || defined(sun)
 if (buf.tm_year + 1900 < 1 || 9999 < buf.tm_year + 1900) {
- PyErr_Format(PyExc_ValueError,
- "strftime() requires year in [1; 9999]",
- buf.tm_year + 1900);
+ PyErr_SetString(PyExc_ValueError,
+ "strftime() requires year in [1; 9999]");
 return NULL;
 }
 #endif
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /