Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2f2b6c6

Browse files
committed
Change to use the new 'translate_longopt()' function from fancy_getopt, rather
than rolling our own with fancy_getopt's 'longopt_xlate' global.
1 parent d644ca2 commit 2f2b6c6

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/distutils/dist.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from copy import copy
1515
from distutils.errors import *
1616
from distutils import sysconfig
17-
from distutils.fancy_getopt import FancyGetopt, longopt_xlate
17+
from distutils.fancy_getopt import FancyGetopt, translate_longopt
1818
from distutils.util import check_environ, strtobool
1919

2020

@@ -86,8 +86,8 @@ class Distribution:
8686
('long-description', None,
8787
"print the long package description"),
8888
]
89-
display_option_names = map(lambda x: string.translate(x[0], longopt_xlate),
90-
display_options)
89+
display_option_names = map(lambda x: translate_longopt(x[0]),
90+
display_options)
9191

9292
# negative options are options that exclude other options
9393
negative_opt = {'quiet': 'verbose'}
@@ -592,7 +592,7 @@ def handle_display_options (self, option_order):
592592

593593
for (opt, val) in option_order:
594594
if val and is_display_option.get(opt):
595-
opt = string.translate (opt, longopt_xlate)
595+
opt = translate_longopt(opt)
596596
print getattr(self.metadata, "get_"+opt)()
597597
any_display_options = 1
598598

@@ -746,7 +746,7 @@ def _set_command_options (self, command_obj, option_dict=None):
746746
for (option, (source, value)) in option_dict.items():
747747
if DEBUG: print " %s = %s (from %s)" % (option, value, source)
748748
try:
749-
bool_opts = command_obj.boolean_options
749+
bool_opts = map(translate_longopt, command_obj.boolean_options)
750750
except AttributeError:
751751
bool_opts = []
752752
try:

0 commit comments

Comments
 (0)