Blob Blame History Raw
From b136862af8f7ef4a2461ad6ffb211e25067a12d5 Mon Sep 17 00:00:00 2001
From: Sandro <devel@penguinpee.nl>
Date: Wed, 27 Mar 2024 22:17:28 +0100
Subject: [PATCH] Replace deprecated function logging.warn()

Function `logging.warn()` has been deprecated since Python 3.3. It will
be removed in Python 3.13. Replace it with `logging.warning()`.
---
 grabbit/extensions/writable.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/grabbit/extensions/writable.py b/grabbit/extensions/writable.py
index fc6d78b..57cc9d3 100644
--- a/grabbit/extensions/writable.py
+++ b/grabbit/extensions/writable.py
@@ -140,11 +140,11 @@ def write_contents_to_file(path, contents=None, link_to=None,
             raise ValueError(msg.format(path))
         elif conflicts == 'skip':
             msg = 'A file at path {} already exists, skipping writing file.'
-            logging.warn(msg.format(path))
+            logging.warning(msg.format(path))
             return
         elif conflicts == 'overwrite':
             if isdir(path):
-                logging.warn('New path is a directory, not going to '
+                logging.warning('New path is a directory, not going to '
                              'overwrite it, skipping instead.')
                 return
             os.remove(path)