Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 71095ea

Browse files
committed
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.
1 parent 14f3ae2 commit 71095ea

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/_strptime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def _strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
298298
for index, arg in enumerate([data_string, format]):
299299
if not isinstance(arg, str):
300300
msg = "strptime() argument {} must be str, not {}"
301-
raise TypeError(msg.format(arg, index))
301+
raise TypeError(msg.format(index, type(arg)))
302302

303303
global _TimeRE_cache, _regex_cache
304304
with _cache_lock:

0 commit comments

Comments
 (0)