#3 Replace deprecated logging.warn() (RHBZ#2246132)
Merged 2 months ago by gui1ty. Opened 2 months ago by gui1ty.
rpms/ gui1ty/python-grabbit three_thirteen  into  rawhide

file added
+29
@@ -0,0 +1,29 @@ 

+ 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)

file modified
+3
@@ -20,6 +20,9 @@ 

  License:        MIT AND Unlicense

  URL:            https://github.com/grabbles/grabbit

  Source:         %{url}/archive/%{version}/grabbit-%{version}.tar.gz

+ # Replace deprecated logging function

+ # https://github.com/grabbles/grabbit/pull/95

+ Patch:          %{url}/pull/95.patch

  

  # Update versioneer from 0.18 to 0.21

  # Fixes Python 3.11 compatiblity (RHBZ#2026767)

Function will be removed from Python 3.13.

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/b9d3dbbfd9cd4077a84117946b3f0232

Pull-Request has been merged by gui1ty

2 months ago
Metadata