Skip to content

Commit f5f1546

Browse files
chris-b1Pingviinituutti
authored andcommitted
CLN: keyerror in versioneer error message (pandas-dev#23974)
1 parent 36841ca commit f5f1546

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pandas/_version.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,14 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
238238
# tag
239239
full_tag = mo.group(1)
240240
if not full_tag.startswith(tag_prefix):
241+
fmt = ("tag '{full_tag}' doesn't start with prefix "
242+
"'{tag_prefix}'")
243+
msg = fmt.format(full_tag=full_tag, tag_prefix=tag_prefix)
241244
if verbose:
242-
fmt = "tag '{full_tag}' doesn't start with prefix " \
243-
"'{tag_prefix}'"
244-
print(fmt.format(full_tag=full_tag, tag_prefix=tag_prefix))
245-
pieces["error"] = ("tag '{full_tag}' doesn't start with "
246-
"prefix '{tag_prefix}'".format(
247-
full_tag, tag_prefix))
245+
print(msg)
246+
pieces["error"] = msg
248247
return pieces
248+
249249
pieces["closest-tag"] = full_tag[len(tag_prefix):]
250250

251251
# distance: number of commits since tag

0 commit comments

Comments
 (0)