summaryrefslogtreecommitdiffstats
path: root/Lib/plat-mac/aetools.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/plat-mac/aetools.py')
-rw-r--r--Lib/plat-mac/aetools.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/Lib/plat-mac/aetools.py b/Lib/plat-mac/aetools.py
index 06a0ddc..55288bf 100644
--- a/Lib/plat-mac/aetools.py
+++ b/Lib/plat-mac/aetools.py
@@ -107,7 +107,7 @@ def keysubst(arguments, keydict):
"""Replace long name keys by their 4-char counterparts, and check"""
ok = keydict.values()
for k in arguments.keys():
- if keydict.has_key(k):
+ if k in keydict:
v = arguments[k]
del arguments[k]
arguments[keydict[k]] = v
@@ -116,11 +116,11 @@ def keysubst(arguments, keydict):
def enumsubst(arguments, key, edict):
"""Substitute a single enum keyword argument, if it occurs"""
- if not arguments.has_key(key) or edict is None:
+ if key not in arguments or edict is None:
return
v = arguments[key]
ok = edict.values()
- if edict.has_key(v):
+ if v in edict:
arguments[key] = Enum(edict[v])
elif not v in ok:
raise TypeError, 'Unknown enumerator: %s'%v
@@ -129,11 +129,11 @@ def decodeerror(arguments):
"""Create the 'best' argument for a raise MacOS.Error"""
errn = arguments['errn']
err_a1 = errn
- if arguments.has_key('errs'):
+ if 'errs' in arguments:
err_a2 = arguments['errs']
else:
err_a2 = MacOS.GetErrorString(errn)
- if arguments.has_key('erob'):
+ if 'erob' in arguments:
err_a3 = arguments['erob']
else:
err_a3 = None
@@ -248,10 +248,10 @@ class TalkTo:
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
- if _arguments.has_key('errn'):
+ if 'errn' in _arguments:
raise Error, decodeerror(_arguments)
- if _arguments.has_key('----'):
+ if '----' in _arguments:
return _arguments['----']
if asfile:
item.__class__ = asfile
@@ -281,7 +281,7 @@ class TalkTo:
if _arguments.get('errn', 0):
raise Error, decodeerror(_arguments)
# XXXX Optionally decode result
- if _arguments.has_key('----'):
+ if '----' in _arguments:
return _arguments['----']
set = _set
@@ -290,10 +290,10 @@ class TalkTo:
# like the "application" class in OSA.
def __getattr__(self, name):
- if self._elemdict.has_key(name):
+ if name in self._elemdict:
cls = self._elemdict[name]
return DelayedComponentItem(cls, None)
- if self._propdict.has_key(name):
+ if name in self._propdict:
cls = self._propdict[name]
return cls()
raise AttributeError, name
@@ -315,10 +315,10 @@ class _miniFinder(TalkTo):
_reply, _arguments, _attributes = self.send(_code, _subcode,
_arguments, _attributes)
- if _arguments.has_key('errn'):
+ if 'errn' in _arguments:
raise Error, decodeerror(_arguments)
# XXXX Optionally decode result
- if _arguments.has_key('----'):
+ if '----' in _arguments:
return _arguments['----']
#pass