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

15 lines
446 B
Diff
Raw Normal View History

--- a/src/binwalk/core/version.py
+++ b/src/binwalk/core/version.py
2021-04-11 17:24:59 +02:00
@@ -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