Skip to content

Commit

Permalink
if import slitherin fails use detector list from slither
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolay19 committed May 7, 2024
1 parent dc7bb1e commit b9ffae2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions utils/slither.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import re
from collections import namedtuple

import slitherin

Finding = namedtuple('Finding', 'address, filename, lines')
class SlitherOutError(Exception):
pass
Expand Down Expand Up @@ -61,7 +59,11 @@ def parse_ascii_table(ascii_table: str):
return header, data

def get_slitherin_detectors() -> list:
return [x.ARGUMENT for x in slitherin.plugin_detectors]
try:
import slitherin
return [x.ARGUMENT for x in slitherin.plugin_detectors]
except ModuleNotFoundError:
return get_slitherin_detectors_from_slither()

def get_slitherin_detectors_from_slither() -> list:
try:
Expand Down

0 comments on commit b9ffae2

Please sign in to comment.