Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fate-suite:
rsync -vrltLW rsync://fate-suite.ffmpeg.org/fate-suite/ tests/assets/fate-suite/

lint:
$(PIP) install -U black isort flake8 flake8-pyproject pillow numpy mypy==1.13.0 pytest
$(PIP) install -U black isort flake8 flake8-pyproject pillow numpy mypy==1.15.0 pytest
black --check av examples tests setup.py
flake8 av
isort --check-only --diff av examples tests
Expand Down
4 changes: 2 additions & 2 deletions av/error.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ def tag_to_code(tag: bytes) -> int: ...
def err_check(res: int, filename: str | None = None) -> int: ...

class FFmpegError(Exception):
errno: int
strerror: str
errno: int | None
strerror: str | None
filename: str
log: tuple[int, tuple[int, str, str] | None]

Expand Down
8 changes: 5 additions & 3 deletions av/error.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,13 @@ class FFmpegError(Exception):
pass

def __str__(self):
msg = f"[Errno {self.errno}] {self.strerror}"

msg = ""
if self.errno is not None:
msg = f"{msg}[Errno {self.errno}] "
if self.strerror is not None:
msg = f"{msg}{self.strerror}"
if self.filename:
msg = f"{msg}: {self.filename!r}"

if self.log:
msg = f"{msg}; last error log: [{self.log[1].strip()}] {self.log[2].strip()}"

Expand Down
Loading