8000 decoder.py: allowing to use it live by d-a-v · Pull Request #9108 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

decoder.py: allowing to use it live #9108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
8000 Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
review: use shutil.which()
  • Loading branch information
d-a-v committed Mar 28, 2024
commit 2d0ba9757d587dccc622593e128492040d4fc14e
6 changes: 3 additions & 3 deletions tools/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import sys
import re
import subprocess
import shutil

# https://github.com/me-no-dev/EspExceptionDecoder/blob/349d17e4c9896306e2c00b4932be3ba510cad208/src/EspExceptionDecoder.java#L59-L90
EXCEPTION_CODES = (
Expand Down Expand Up @@ -189,9 +190,8 @@ def select_tool(toolchain_path, tool, func):
path = f"xtensa-lx106-elf-{tool}"
if toolchain_path:
path = os.path.join(toolchain_path, path)
if not os.path.isfile(path):
print(f"error: not existing tool (path -- tool): '{path}'", file=sys.stderr)
sys.exit(1)
if not shutil.which(path):
raise FileNotFoundError(path)

def formatter(func, path):
def wrapper(elf, addresses):
Expand Down
0