From efe84521e0ab9025fcb84d51f695e8e8002b57ff Mon Sep 17 00:00:00 2001 From: zebra-lucky Date: Fri, 28 Nov 2025 21:41:43 +0200 Subject: [PATCH] replace deprecated log.warn part2 --- scripts/joinmarket-qt.py | 8 +++++--- scripts/snicker/snicker-server.py | 8 ++++---- scripts/yg-privacyenhanced.py | 5 +++-- test/jmclient/test_frost_ipc.py | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/scripts/joinmarket-qt.py b/scripts/joinmarket-qt.py index 963f435..2d9d30d 100755 --- a/scripts/joinmarket-qt.py +++ b/scripts/joinmarket-qt.py @@ -284,7 +284,8 @@ class SettingsTab(QDialog): log.debug('setting section: ' + section + ' and name: ' + oname + ' to: ' + oval) if not update_persist_config(section, oname, oval): - log.warn("Unable to persist config change to file: " + str(section) + str(oname) + str(oval)) + log.warning("Unable to persist config change to file: " + + str(section) + str(oname) + str(oval)) else: #currently there is only QLineEdit log.debug('setting section: ' + section + ' and name: ' + str(t[ @@ -292,8 +293,9 @@ class SettingsTab(QDialog): if not update_persist_config(section, str(t[0].text()), str(t[1].text())): # we don't include GUI as it's not required to be persisted: if not section == "GUI": - log.warn("Unable to persist config change to file: " + str( - section) + str(t[0].text()) + str(t[1].text())) + log.warning("Unable to persist config change to file: " + + str(section) + str(t[0].text()) + + str(t[1].text())) if str(t[0].text()) == 'blockchain_source': jm_single().bc_interface = get_blockchain_interface_instance( jm_single().config) diff --git a/scripts/snicker/snicker-server.py b/scripts/snicker/snicker-server.py index da11b03..2577501 100755 --- a/scripts/snicker/snicker-server.py +++ b/scripts/snicker/snicker-server.py @@ -159,8 +159,8 @@ class SNICKERServer(Resource): bin_nonce = hextobin(nonce.decode('utf-8')) base64.b64decode(encryptedtx) except: - log.warn("This proposal was not accepted: " + proposal.decode( - "utf-8")) + log.warning("This proposal was not accepted: " + + proposal.decode("utf-8")) # give up immediately in case of format error: return self.return_error(request, "Invalid request format", "invalid-request-format") @@ -185,8 +185,8 @@ class SNICKERServer(Resource): self.cursor.execute('INSERT INTO {} VALUES(?, ?);'.format( database_table_name),proposal_to_add) except sqlite3.Error as e: - log.warn("Error inserting data into table: {}".format( - " ".join(e.args))) + log.warning("Error inserting data into table:" + " {}".format(" ".join(e.args))) return False self.conn.commit() return True diff --git a/scripts/yg-privacyenhanced.py b/scripts/yg-privacyenhanced.py index 9425e46..f0908d5 100755 --- a/scripts/yg-privacyenhanced.py +++ b/scripts/yg-privacyenhanced.py @@ -77,8 +77,9 @@ class YieldGeneratorPrivacyEnhanced(YieldGeneratorBasic): self.minsize * (1 - float(self.size_factor)), self.minsize * (1 + float(self.size_factor)))) if randomize_minsize < jm_single().DUST_THRESHOLD: - jlog.warn("Minsize was randomized to below dust; resetting to dust " - "threshold: " + amount_to_str(jm_single().DUST_THRESHOLD)) + jlog.warning("Minsize was randomized to below dust; resetting to" + " dust threshold: " + + amount_to_str(jm_single().DUST_THRESHOLD)) randomize_minsize = jm_single().DUST_THRESHOLD possible_maxsize = mix_balance[max_mix] - max(jm_single().DUST_THRESHOLD, randomize_txfee) randomize_maxsize = int(random.uniform(possible_maxsize * (1 - float(self.size_factor)), diff --git a/test/jmclient/test_frost_ipc.py b/test/jmclient/test_frost_ipc.py index 918753c..4ef39ae 100644 --- a/test/jmclient/test_frost_ipc.py +++ b/test/jmclient/test_frost_ipc.py @@ -61,7 +61,7 @@ class DummyFrostJMClientProtocol: if session_id is None: session_id, _, session = self.dkg_init(*md_type_idx) if session_id is None: - log.warn('could not get session_id from dkg_init}') + log.warning('could not get session_id from dkg_init}') await asyncio.sleep(5) continue