diff options
-rw-r--r-- | src/nbblib/commands.py | 2 | ||||
-rw-r--r-- | src/nbblib/main.py | 2 | ||||
-rw-r--r-- | src/nbblib/plugins.py | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/nbblib/commands.py b/src/nbblib/commands.py index 4a9a17f..e5eab40 100644 --- a/src/nbblib/commands.py +++ b/src/nbblib/commands.py @@ -357,7 +357,7 @@ class UnknownCommand(Exception): __all__.append('NBB_Command') class NBB_Command(object): def __init__(self, cmd, cmdargs, context): - if Command.plugins.has_key(cmd): + if cmd in Command.plugins: try: c = Command.plugins[cmd](*cmdargs, **{'context':context}) c.run() diff --git a/src/nbblib/main.py b/src/nbblib/main.py index 3800665..fabbdad 100644 --- a/src/nbblib/main.py +++ b/src/nbblib/main.py @@ -101,7 +101,7 @@ class InvalidPropertyValue(Exception): class Property(object): def __init__(self, *args, **kwargs): assert(len(args) == 0) - if kwargs.has_key('default'): + if 'default' in kwargs: self.default = kwargs['default'] valid_kwargs = ('default',) for kwa in kwargs.iterkeys(): diff --git a/src/nbblib/plugins.py b/src/nbblib/plugins.py index c71be79..784b49e 100644 --- a/src/nbblib/plugins.py +++ b/src/nbblib/plugins.py @@ -182,7 +182,7 @@ class PluginDict(dict): # This is the important difference between PluginDict and dict. def __setitem__(self, key, value): - if self.has_key(key): + if key in self: raise DuplicatePluginName() else: super(PluginDict, self).__setitem__(key, value) |