From 4c2df87e54eafdf242f5cd56fcaa69563d987558 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Fri, 26 Sep 2025 10:40:23 +0000 Subject: [PATCH] minor fixes and cleanups --- mmgen/cfg.py | 5 +---- mmgen/crypto.py | 2 +- test/modtest_d/amt.py | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/mmgen/cfg.py b/mmgen/cfg.py index 989f1020..d9af6a9f 100755 --- a/mmgen/cfg.py +++ b/mmgen/cfg.py @@ -113,10 +113,7 @@ class GlobalConstants(Lockable): # https://importlib-resources.readthedocs.io/en/latest/migration.html # https://setuptools.readthedocs.io/en/latest/pkg_resources.html - try: - from importlib.resources import files # Python 3.9 and above - except ImportError: - from importlib_resources import files + from importlib.resources import files return files(package).joinpath('data', filename).read_text() @property diff --git a/mmgen/crypto.py b/mmgen/crypto.py index a212c1bd..2210eacb 100755 --- a/mmgen/crypto.py +++ b/mmgen/crypto.py @@ -40,7 +40,7 @@ class Crypto: mmenc_nonce_len = 32 # Scrypt params: 'id_num': [N, r, p] (N is an exponent of two) - # NB: hashlib.scrypt in Python (>=v3.6) supports max N value of 14. This means that + # NB: scrypt() in Python hashlib supports max N value of 14. This means that # for hash presets > 3 the standalone scrypt library must be used! _hp = namedtuple('scrypt_preset', ['N', 'r', 'p']) hash_presets = { diff --git a/test/modtest_d/amt.py b/test/modtest_d/amt.py index 5dc5a821..253db9bf 100755 --- a/test/modtest_d/amt.py +++ b/test/modtest_d/amt.py @@ -21,7 +21,7 @@ def test_to_unit(data): for proto, amt, unit, chk in data: amt = protos[proto].coin_amt(amt) res = amt.to_unit(unit) - vmsg(f' {proto.upper()} {amt.fmt(8)} => {res:<14} {unit}') + vmsg(f' {proto.upper()} {amt.fmt(4):<24} => {res:<21} {unit}') if '.' in chk: assert res == Decimal(chk), f'{res} != {Decimal(chk)}' else: