]> granicus.if.org Git - python/commitdiff
The message for the exception when time.strptime was passed something other
authorBrett Cannon <bcannon@gmail.com>
Tue, 31 Mar 2009 03:58:04 +0000 (03:58 +0000)
committerBrett Cannon <bcannon@gmail.com>
Tue, 31 Mar 2009 03:58:04 +0000 (03:58 +0000)
than str did not output the type of the argument but the object itself.

Lib/_strptime.py

index 9ff29bce8f7678c7ba3ac3b5f6f03ae340cd1c99..ee30b4216c25c8fa9825d8f13fc0ccdbefd15575 100644 (file)
@@ -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: