summaryrefslogtreecommitdiff
path: root/setuptools/_distutils/fancy_getopt.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2022-08-02 21:03:33 -0400
committerJason R. Coombs <jaraco@jaraco.com>2022-08-02 21:13:43 -0400
commite90b97304d50eb1246197014ca2d794987ce1934 (patch)
tree23e9f77cedeeb30cd3765fd1e35862c2eb89cffb /setuptools/_distutils/fancy_getopt.py
parent9b0cf7e1dfd8c3e11a47a9b3c7f4385745d50daf (diff)
parentc397f4c164e0a6f49a1ac3a70f5c80fe05785ed6 (diff)
downloadpython-setuptools-git-e90b97304d50eb1246197014ca2d794987ce1934.tar.gz
Merge https://github.com/pypa/distutils into bugfix/distutils-164
Diffstat (limited to 'setuptools/_distutils/fancy_getopt.py')
-rw-r--r--setuptools/_distutils/fancy_getopt.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/setuptools/_distutils/fancy_getopt.py b/setuptools/_distutils/fancy_getopt.py
index 9ee06420..830f047e 100644
--- a/setuptools/_distutils/fancy_getopt.py
+++ b/setuptools/_distutils/fancy_getopt.py
@@ -22,7 +22,7 @@ longopt_pat = r'[a-zA-Z](?:[a-zA-Z0-9-]*)'
longopt_re = re.compile(r'^%s$' % longopt_pat)
# For recognizing "negative alias" options, eg. "quiet=!verbose"
-neg_alias_re = re.compile("^(%s)=!(%s)$" % (longopt_pat, longopt_pat))
+neg_alias_re = re.compile("^({})=!({})$".format(longopt_pat, longopt_pat))
# This is used to translate long options to legitimate Python identifiers
# (for use as attributes of some object).
@@ -157,7 +157,7 @@ class FancyGetopt:
else:
# the option table is part of the code, so simply
# assert that it is correct
- raise ValueError("invalid option tuple: %r" % (option,))
+ raise ValueError("invalid option tuple: {!r}".format(option))
# Type- and value-check the option names
if not isinstance(long, str) or len(long) < 2:
@@ -359,7 +359,7 @@ class FancyGetopt:
# Case 2: we have a short option, so we have to include it
# just after the long option
else:
- opt_names = "%s (-%s)" % (long, short)
+ opt_names = "{} (-{})".format(long, short)
if text:
lines.append(" --%-*s %s" % (max_opt, opt_names, text[0]))
else: