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

15 lines
447 B
Diff
Raw Normal View History

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