#17572: merge with 3.3.

This commit is contained in:
Ezio Melotti 2013-04-04 02:16:27 +03:00
commit d57f047665
4 changed files with 16 additions and 1 deletions

View file

@ -326,7 +326,7 @@ def _strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
bad_directive = "%"
del err
raise ValueError("'%s' is a bad directive in format '%s'" %
(bad_directive, format))
(bad_directive, format)) from None
# IndexError only occurs when the format string is "%"
except IndexError:
raise ValueError("stray %% in format '%s'" % format)