Skip to content

Commit b49c14e

Browse files
fametranoachow101
authored andcommitted
use warning instead of deprecated warn
1 parent 17d5643 commit b49c14e

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

hwilib/commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def enumerate(password: Optional[str] = None, expert: bool = False, chain: Chain
118118
except ImportError as e:
119119
# Warn for ImportErrors, but largely ignore them to allow users not install
120120
# all device dependencies if only one or some devices are wanted.
121-
logging.warn(f"{e}, required for {module}. Ignore if you do not want this device.")
121+
logging.warning(f"{e}, required for {module}. Ignore if you do not want this device.")
122122
pass
123123
return result
124124

hwilib/devices/jadepy/jade.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,7 @@ def drain(self):
15411541
Log any/all outstanding messages/data.
15421542
NOTE: can run indefinitely if data is arriving constantly.
15431543
"""
1544-
logger.warn("Draining interface...")
1544+
logger.warning("Draining interface...")
15451545
drained = bytearray()
15461546
finished = False
15471547

@@ -1552,14 +1552,14 @@ def drain(self):
15521552

15531553
if finished or byte_ == b'\n' or len(drained) > 256:
15541554
try:
1555-
device_logger.warn(drained.decode('utf-8'))
1555+
device_logger.warning(drained.decode('utf-8'))
15561556
except Exception as e:
15571557
# Dump the bytes raw and as hex if decoding as utf-8 failed
1558-
device_logger.warn("Raw:")
1559-
device_logger.warn(drained)
1560-
device_logger.warn("----")
1561-
device_logger.warn("Hex dump:")
1562-
device_logger.warn(drained.hex())
1558+
device_logger.warning("Raw:")
1559+
device_logger.warning(drained)
1560+
device_logger.warning("----")
1561+
device_logger.warning("Hex dump:")
1562+
device_logger.warning(drained.hex())
15631563

15641564
# Clear and loop to continue collecting
15651565
drained.clear()
@@ -1693,7 +1693,7 @@ def read_cbor_message(self):
16931693
response = message['log'].decode("utf-8")
16941694
log_methods = {
16951695
'E': device_logger.error,
1696-
'W': device_logger.warn,
1696+
'W': device_logger.warning,
16971697
'I': device_logger.info,
16981698
'D': device_logger.debug,
16991699
'V': device_logger.debug,

0 commit comments

Comments
 (0)