systemd/0409-test-replace-readfp-with-read_file.patch
Jan Macku d3e892ecce systemd-252-20
Resolves: RHEL-13199,RHEL-16354,RHEL-5988
2023-12-08 10:00:06 +01:00

29 lines
1.0 KiB
Diff

From 8fced1b2ed30b9cda338c35946d8dcc3820ac25a Mon Sep 17 00:00:00 2001
From: Frantisek Sumsal <frantisek@sumsal.cz>
Date: Wed, 5 Jul 2023 19:43:43 +0200
Subject: [PATCH] test: replace readfp() with read_file()
ConfigParser.readfp() has been deprecated since Python 3.2 and was
dropped completely in Python 3.11.
(cherry picked from commit ba4a1cd8a863f65ff016be72e520c323aa1e1a6f)
Related: RHEL-13199
---
test/sysv-generator-test.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/sysv-generator-test.py b/test/sysv-generator-test.py
index 484b610a02..84237bab61 100755
--- a/test/sysv-generator-test.py
+++ b/test/sysv-generator-test.py
@@ -80,7 +80,7 @@ class SysvGeneratorTest(unittest.TestCase):
cp = RawConfigParser(dict_type=MultiDict)
cp.optionxform = lambda o: o # don't lower-case option names
with open(service) as f:
- cp.readfp(f)
+ cp.read_file(f)
results[os.path.basename(service)] = cp
return (err, results)