Skip to content

Commit

Permalink
fix panda_jungle static analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
adeebshihadeh committed Apr 27, 2022
1 parent 049b163 commit bfeaf35
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tools/replay/can_replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
from selfdrive.boardd.boardd import can_capnp_to_can_list
from tools.lib.logreader import LogReader
from panda import Panda

try:
from panda_jungle import PandaJungle # pylint: disable=import-error
except Exception:
PandaJungle = None
# this bool can be replaced when mypy understands this pattern
panda_jungle_imported = True
from panda_jungle import PandaJungle # pylint: disable=import-error # type: ignore
except ImportError:
PandaJugnle = None
panda_jungle_imported = False


def send_thread(s, flock):
Expand Down Expand Up @@ -82,7 +86,7 @@ def connect():


if __name__ == "__main__":
if PandaJungle is None:
if panda_jungle_imported:
print("\33[31m", "WARNING: cannot connect to jungles. Clone the jungle library to enable support:", "\033[0m")
print("\033[34m", f"cd {BASEDIR} && git clone https://github.com/commaai/panda_jungle", "\033[0m")

Expand Down

2 comments on commit bfeaf35

@CruelSenpai
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 20: PandaJungle is spelled incorrectly.

@pd0wm
Copy link
Contributor

@pd0wm pd0wm commented on bfeaf35 Apr 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also be if not panda_jungle_imported:

Please sign in to comment.