mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-10-27 07:52:03 +00:00
Merge pull request #913 from PR0M3TH3AN/refactor-imghdr-compat-16272458806887022852
🧹 Refactor imghdr compatibility hack to dedicated compat module
This commit is contained in:
2 files changed
+12
-9
No files matched your search
@@ -0,0 +1,11 @@
|
||||
"""Compatibility layer for different Python versions."""
|
||||
|
||||
import sys
|
||||
|
||||
# Ensure the ``imghdr`` module is available for ``pgpy`` on Python 3.13+
|
||||
try: # pragma: no cover - only executed on Python >= 3.13
|
||||
import imghdr # type: ignore
|
||||
except ModuleNotFoundError: # pragma: no cover - fallback for removed module
|
||||
from utils import imghdr_stub
|
||||
|
||||
sys.modules.setdefault("imghdr", imghdr_stub)
|
||||
@@ -35,15 +35,7 @@ from cryptography.hazmat.primitives.asymmetric import ed25519
|
||||
from cryptography.hazmat.backends import default_backend
|
||||
from bip_utils import Bip39SeedGenerator
|
||||
|
||||
# Ensure the ``imghdr`` module is available for ``pgpy`` on Python 3.13+
|
||||
try: # pragma: no cover - only executed on Python >= 3.13
|
||||
import imghdr # type: ignore
|
||||
except ModuleNotFoundError: # pragma: no cover - fallback for removed module
|
||||
from utils import imghdr_stub as imghdr # type: ignore
|
||||
import sys
|
||||
|
||||
sys.modules.setdefault("imghdr", imghdr)
|
||||
|
||||
from . import compat # noqa: F401
|
||||
from local_bip85.bip85 import BIP85
|
||||
|
||||
from constants import (
|
||||
|
||||
Reference in new issue
Block a user