Skip to content

Commit 046e54b

Browse files
committed
fix: object type checks
1 parent 80d8c96 commit 046e54b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

errbot/botplugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def recurse_check_structure(sample: Any, to_check: Any) -> None:
4444
recurse_check_structure(sample[0], element)
4545
return
4646

47-
if sample_type == dict:
47+
if sample_type == dict: # noqa: E721
4848
for key in sample:
4949
if key not in to_check:
5050
raise ValidationException(f"{to_check} doesn't contain the key {key}.")

errbot/core_plugins/plugins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def plugin_config(self, _, args):
187187
except Exception:
188188
self.log.exception("Invalid expression for the configuration of the plugin")
189189
return "Syntax error in the given configuration"
190-
if type(real_config_obj) != type(template_obj):
190+
if type(real_config_obj) is not type(template_obj):
191191
return "It looks fishy, your config type is not the same as the template!"
192192

193193
self._bot.plugin_manager.set_plugin_configuration(plugin_name, real_config_obj)

tools/plugin-gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def check_repo(repo):
187187
repo_entry[name] = plugin
188188
plugins[repo_name] = repo_entry
189189
log.debug("Catalog added plugin %s.", plugin["name"])
190-
except:
190+
except Exception:
191191
log.error("Invalid syntax in %s, skipping...", plug["path"])
192192
continue
193193

0 commit comments

Comments
 (0)