[Python-checkins] CVS: distutils/distutils fancy_getopt.py,1.14,1.15
Greg Ward
python-dev@python.org
Sun, 6 Aug 2000 17:45:53 -0700
Update of /cvsroot/python/distutils/distutils
In directory slayer.i.sourceforge.net:/tmp/cvs-serv13910
Modified Files:
fancy_getopt.py
Log Message:
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).
Index: fancy_getopt.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/fancy_getopt.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** fancy_getopt.py 2000/06/08 00:35:33 1.14
--- fancy_getopt.py 2000/08/07 00:45:51 1.15
***************
*** 94,97 ****
--- 94,98 ----
def _build_index (self):
+ self.option_index.clear()
for option in self.option_table:
self.option_index[option[0]] = option
***************
*** 153,156 ****
--- 154,161 ----
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: