summaryrefslogtreecommitdiffstats
path: root/Lib/_strptime.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-11-24 16:15:37 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-11-24 16:15:37 (GMT)
commitcdac302af362f275f31c13e143f78ec682ef7b68 (patch)
tree67f2c16bfe74aa6d1421627955e49ff5389d186b /Lib/_strptime.py
parent44d2429a25589950284bd13c9343657e73f4927f (diff)
downloadcpython-cdac302af362f275f31c13e143f78ec682ef7b68.zip
cpython-cdac302af362f275f31c13e143f78ec682ef7b68.tar.gz
cpython-cdac302af362f275f31c13e143f78ec682ef7b68.tar.bz2
Issue #19545: Avoid chained exceptions while passing stray % to
time.strptime(). Initial patch by Claudiu Popa.
Diffstat (limited to 'Lib/_strptime.py')
-rw-r--r--Lib/_strptime.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/_strptime.py b/Lib/_strptime.py
index 264d4fa..9058a69 100644
--- a/Lib/_strptime.py
+++ b/Lib/_strptime.py
@@ -329,7 +329,7 @@ def _strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
(bad_directive, format)) from None
# IndexError only occurs when the format string is "%"
except IndexError:
- raise ValueError("stray %% in format '%s'" % format)
+ raise ValueError("stray %% in format '%s'" % format) from None
_regex_cache[format] = format_regex
found = format_regex.match(data_string)
if not found: