klippy: Replace deprecated logger.warn with logger.warning (#6385)

Replace deprecated logger.warn with logger.warning

logger.warn will be removed in Python 3.13

Signed-off-by: Thijs Triemstra <info@collab.nl>
This commit is contained in:
Thijs Triemstra
2023-11-17 04:06:13 +01:00
committed by GitHub
parent 3f8f30d612
commit 4688c21c54
6 changed files with 19 additions and 16 deletions

View File

@@ -172,16 +172,16 @@ class PrinterConfig:
autosave_data = data[pos + len(AUTOSAVE_HEADER):].strip()
# Check for errors and strip line prefixes
if "\n#*# " in regular_data:
logging.warn("Can't read autosave from config file"
" - autosave state corrupted")
logging.warning("Can't read autosave from config file"
" - autosave state corrupted")
return data, ""
out = [""]
for line in autosave_data.split('\n'):
if ((not line.startswith("#*#")
or (len(line) >= 4 and not line.startswith("#*# ")))
and autosave_data):
logging.warn("Can't read autosave from config file"
" - modifications after header")
logging.warning("Can't read autosave from config file"
" - modifications after header")
return data, ""
out.append(line[4:])
out.append("")