void-packages/srcpkgs/binwalk/patches/fallback-version.patch

15 lines
446 B
Diff

--- a/src/binwalk/core/version.py
+++ b/src/binwalk/core/version.py
@@ -1,6 +1,10 @@
try:
from importlib import metadata
- get_version = lambda : metadata.version("binwalk")
+ def get_version():
+ try:
+ return metadata.version("binwalk")
+ except metadata.PackageNotFoundError:
+ return "unknown"
except ImportError:
try:
# Running on pre-3.8 Python; use importlib-metadata package