From: Brett Cannon Date: Tue, 31 Mar 2009 03:58:04 +0000 (+0000) Subject: The message for the exception when time.strptime was passed something other X-Git-Tag: v3.1a2~145 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=71095ea4ce1b8584d89047f2256b183d40cc9d35;p=thirdparty%2FPython%2Fcpython.git The message for the exception when time.strptime was passed something other than str did not output the type of the argument but the object itself. --- diff --git a/Lib/_strptime.py b/Lib/_strptime.py index 9ff29bce8f76..ee30b4216c25 100644 --- a/Lib/_strptime.py +++ b/Lib/_strptime.py @@ -298,7 +298,7 @@ def _strptime(data_string, format="%a %b %d %H:%M:%S %Y"): for index, arg in enumerate([data_string, format]): if not isinstance(arg, str): msg = "strptime() argument {} must be str, not {}" - raise TypeError(msg.format(arg, index)) + raise TypeError(msg.format(index, type(arg))) global _TimeRE_cache, _regex_cache with _cache_lock: