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.
This commit is contained in:
Brett Cannon 2009-03-31 03:58:04 +00:00
parent 14f3ae2723
commit 71095ea4ce
1 changed files with 1 additions and 1 deletions

View 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: