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

Skip to content

Commit 68ded6e

Browse files
committed
Added 'translate_longopt()' function.
1 parent 2f2b6c6 commit 68ded6e

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Lib/distutils/fancy_getopt.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,13 @@ def wrap_text (text, width):
470470
return lines
471471

472472
# wrap_text ()
473+
474+
475+
def translate_longopt (opt):
476+
"""Convert a long option name to a valid Python identifier by
477+
changing "-" to "_".
478+
"""
479+
return string.translate(opt, longopt_xlate)
473480

474481

475482
class OptionDummy:

0 commit comments

Comments
 (0)