From 68ded6e6f148ef0dc95418be7a9bb61385942362 Mon Sep 17 00:00:00 2001 From: Greg Ward Date: Mon, 25 Sep 2000 01:58:31 +0000 Subject: [PATCH] Added 'translate_longopt()' function. --- Lib/distutils/fancy_getopt.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Lib/distutils/fancy_getopt.py b/Lib/distutils/fancy_getopt.py index eaf60737605..f93520019f6 100644 --- a/Lib/distutils/fancy_getopt.py +++ b/Lib/distutils/fancy_getopt.py @@ -470,6 +470,13 @@ def wrap_text (text, width): return lines # wrap_text () + + +def translate_longopt (opt): + """Convert a long option name to a valid Python identifier by + changing "-" to "_". + """ + return string.translate(opt, longopt_xlate) class OptionDummy: