Skip to content

Commit 9f3875c

Browse files
committed
CLN: convert ValueError messages from #GH-26583 to formatted str
1 parent 1e97e8b commit 9f3875c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pandas/_libs/tslibs/strptime.pyx

+6-6
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,14 @@ def array_strptime(object[:] values, object fmt,
139139
if is_coerce:
140140
iresult[i] = NPY_NAT
141141
continue
142-
raise ValueError("time data %r does not match "
143-
"format %r (match)" % (val, fmt))
142+
raise ValueError("time data {} does not match "
143+
"format {} (match)".format(val, fmt))
144144
if len(val) != found.end():
145145
if is_coerce:
146146
iresult[i] = NPY_NAT
147147
continue
148-
raise ValueError("unconverted data remains: %s" %
149-
val[found.end():])
148+
raise ValueError("unconverted data remains: {}"
149+
.format(val[found.end():]))
150150

151151
# search
152152
else:
@@ -155,8 +155,8 @@ def array_strptime(object[:] values, object fmt,
155155
if is_coerce:
156156
iresult[i] = NPY_NAT
157157
continue
158-
raise ValueError("time data %r does not match format "
159-
"%r (search)" % (val, fmt))
158+
raise ValueError("time data {} does not match "
159+
"format {} (search)".format(val, fmt))
160160

161161
iso_year = -1
162162
year = 1900

0 commit comments

Comments
 (0)