diff --git a/slither/slither.py b/slither/slither.py index 5453c186db..c01d2db096 100644 --- a/slither/slither.py +++ b/slither/slither.py @@ -23,7 +23,6 @@ def _check_common_things( thing_name: str, cls: Type, base_cls: Type, instances_list: List[Type[AbstractDetector]] ) -> None: - if not issubclass(cls, base_cls) or cls is base_cls: raise Exception( f"You can't register {cls!r} as a {thing_name}. You need to pass a class that inherits from {base_cls.__name__}" @@ -135,7 +134,6 @@ def __init__(self, target: Union[str, CryticCompile], **kwargs) -> None: self._init_parsing_and_analyses(kwargs.get("skip_analyze", False)) def _init_parsing_and_analyses(self, skip_analyze: bool) -> None: - for parser in self._parsers: try: parser.parse_contracts() @@ -196,17 +194,17 @@ def register_printer(self, printer_class: Type[AbstractPrinter]) -> None: instance = printer_class(self, logger_printer) self._printers.append(instance) - + def deregister_printer(self, printer_class: Type[AbstractPrinter]) -> None: """ :param printer_class: Class inheriting from `AbstractPrinter`. """ for obj in self._printers: - if type(obj) == printer_class : # pylint: disable=unidiomatic-typecheck + if type(obj) == printer_class: # pylint: disable=unidiomatic-typecheck self._printers.remove(obj) return - + def run_detectors(self) -> List[Dict]: """ :return: List of registered detectors results.