mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
#17572: merge with 3.3.
This commit is contained in:
commit
d57f047665
4 changed files with 16 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue