Browse Source

Removed repeated conditionnal statements

The exact same conditionnal statement throwing error if ptype is unknown
in Plugin.register() is already executed by
MetaPlugType.type_from_name(), which is called right after it. Guessing
which class should be concerned by such a check, I ended up removing it
in Plugin.
Quentin Bonaventure 8 years ago
parent
commit
dab816f228
1 changed files with 0 additions and 2 deletions
  1. 0
    2
      lodel/plugin/plugins.py

+ 0
- 2
lodel/plugin/plugins.py View File

608
             raise PluginError("No plugin named %s found" % plugin_name)
608
             raise PluginError("No plugin named %s found" % plugin_name)
609
         pinfos = pdcache['plugins'][plugin_name]
609
         pinfos = pdcache['plugins'][plugin_name]
610
         ptype = pinfos['type']
610
         ptype = pinfos['type']
611
-        if ptype not in MetaPlugType.all_ptype_names():
612
-            raise PluginError("Unknown plugin type '%s'" % ptype)
613
         pcls = MetaPlugType.type_from_name(ptype)
611
         pcls = MetaPlugType.type_from_name(ptype)
614
         plugin = pcls(plugin_name)
612
         plugin = pcls(plugin_name)
615
         cls._plugin_instances[plugin_name] = plugin
613
         cls._plugin_instances[plugin_name] = plugin

Loading…
Cancel
Save