diff options
| author | Greg Ward <gward@python.net> | 2000-08-07 00:45:51 +0000 |
|---|---|---|
| committer | Greg Ward <gward@python.net> | 2000-08-07 00:45:51 +0000 |
| commit | d6bdb1ca69a126e1c651d06d304c283ca304254a (patch) | |
| tree | a44baf15f43140a04656d546ee31b4b81686b964 /fancy_getopt.py | |
| parent | 177d3705cc1ffcd1b068776baea88dd5f44259cb (diff) | |
| download | python-setuptools-git-d6bdb1ca69a126e1c651d06d304c283ca304254a.tar.gz | |
Fix so we clear or reinitialize various data structures before populating
(allows the same FancyGetopt object to be used multiple times with different
option tables).
Diffstat (limited to 'fancy_getopt.py')
| -rw-r--r-- | fancy_getopt.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fancy_getopt.py b/fancy_getopt.py index 6adfc819..a62bc0df 100644 --- a/fancy_getopt.py +++ b/fancy_getopt.py @@ -93,6 +93,7 @@ class FancyGetopt: def _build_index (self): + self.option_index.clear() for option in self.option_table: self.option_index[option[0]] = option @@ -153,6 +154,10 @@ class FancyGetopt: the option table. Called by 'getopt()' before it can do anything worthwhile.""" + self.long_opts = [] + self.short_opts = [] + self.short2long.clear() + for option in self.option_table: try: (long, short, help) = option |
