summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2004-08-02 17:58:51 (GMT)
committerFred Drake <fdrake@acm.org>2004-08-02 17:58:51 (GMT)
commit576298d3b2f5e4c071e6f68879b8f900bdc9b80e (patch)
tree94eb205d43ab67982671261e7726699fafdbab2e /Lib
parentc75f11222c0a6c6fb2856c613a27df0a49c0695a (diff)
downloadcpython-576298d3b2f5e4c071e6f68879b8f900bdc9b80e.zip
cpython-576298d3b2f5e4c071e6f68879b8f900bdc9b80e.tar.gz
cpython-576298d3b2f5e4c071e6f68879b8f900bdc9b80e.tar.bz2
- fix description of option table entries
- fix broken assert statement; should just raise
Diffstat (limited to 'Lib')
-rw-r--r--Lib/distutils/fancy_getopt.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/distutils/fancy_getopt.py b/Lib/distutils/fancy_getopt.py
index 512bc9b..6c1134f 100644
--- a/Lib/distutils/fancy_getopt.py
+++ b/Lib/distutils/fancy_getopt.py
@@ -45,8 +45,9 @@ class FancyGetopt:
def __init__ (self, option_table=None):
- # The option table is (currently) a list of 3-tuples:
- # (long_option, short_option, help_string)
+ # The option table is (currently) a list of tuples. The
+ # tuples may have 3 or four values:
+ # (long_option, short_option, help_string [, repeatable])
# if an option takes an argument, its long_option should have '='
# appended; short_option should just be a single character, no ':'
# in any case. If a long_option doesn't have a corresponding
@@ -162,7 +163,7 @@ class FancyGetopt:
else:
# the option table is part of the code, so simply
# assert that it is correct
- assert "invalid option tuple: %r" % (option,)
+ raise ValueError, "invalid option tuple: %r" % (option,)
# Type- and value-check the option names
if type(long) is not StringType or len(long) < 2: