summaryrefslogtreecommitdiff
path: root/extras/optparse.py
diff options
context:
space:
mode:
Diffstat (limited to 'extras/optparse.py')
-rw-r--r--extras/optparse.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/extras/optparse.py b/extras/optparse.py
index ae769301d..c21663c55 100644
--- a/extras/optparse.py
+++ b/extras/optparse.py
@@ -472,7 +472,7 @@ class Option:
def _set_attrs (self, attrs):
for attr in self.ATTRS:
- if attr in attrs:
+ if attrs.has_key(attr):
setattr(self, attr, attrs[attr])
del attrs[attr]
else:
@@ -676,7 +676,7 @@ class Values:
are silently ignored.
"""
for attr in dir(self):
- if attr in dict:
+ if dict.has_key(attr):
dval = dict[attr]
if dval is not None:
setattr(self, attr, dval)
@@ -786,10 +786,10 @@ class OptionContainer:
def _check_conflict (self, option):
conflict_opts = []
for opt in option._short_opts:
- if opt in self._short_opt:
+ if self._short_opt.has_key(opt):
conflict_opts.append((opt, self._short_opt[opt]))
for opt in option._long_opts:
- if opt in self._long_opt:
+ if self._long_opt.has_key(opt):
conflict_opts.append((opt, self._long_opt[opt]))
if conflict_opts:
@@ -837,7 +837,7 @@ class OptionContainer:
if option.dest is not None: # option has a dest, we need a default
if option.default is not NO_DEFAULT:
self.defaults[option.dest] = option.default
- elif option.dest not in self.defaults:
+ elif not self.defaults.has_key(option.dest):
self.defaults[option.dest] = None
return option
@@ -853,8 +853,8 @@ class OptionContainer:
self._long_opt.get(opt_str))
def has_option (self, opt_str):
- return (opt_str in self._short_opt or
- opt_str in self._long_opt)
+ return (self._short_opt.has_key(opt_str) or
+ self._long_opt.has_key(opt_str))
def remove_option (self, opt_str):
option = self._short_opt.get(opt_str)
@@ -1393,7 +1393,7 @@ def _match_abbrev (s, wordmap):
'words', raise BadOptionError.
"""
# Is there an exact match?
- if s in wordmap:
+ if wordmap.has_key(s):
return s
else:
# Isolate all words with s as a prefix.