Fix build with Python 3.12.1
https://github.com/python/cpython/issues/108303 relocated all test data, and is being backported to stable branches.
This commit is contained in:
parent
39cb1875a3
commit
bad6e69ede
29
0001-Fix-tests-with-python-3.12.1.patch
Normal file
29
0001-Fix-tests-with-python-3.12.1.patch
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
From 033c0aa3e1a51cb70a97762252059e70cc2f671c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Daniel Garcia Moreno <daniel.garcia@suse.com>
|
||||||
|
Date: Wed, 20 Dec 2023 12:40:14 +0100
|
||||||
|
Subject: [PATCH] Fix tests with python 3.11.7
|
||||||
|
|
||||||
|
---
|
||||||
|
Backported to 0.5 (s/six/io/ below)
|
||||||
|
|
||||||
|
tests/test_compat.py | 3 +++
|
||||||
|
1 file changed, 3 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/tests/test_compat.py b/tests/test_compat.py
|
||||||
|
index 8d7c785..86d0524 100644
|
||||||
|
--- a/tests/test_compat.py
|
||||||
|
+++ b/tests/test_compat.py
|
||||||
|
@@ -1,3 +1,4 @@
|
||||||
|
+import os
|
||||||
|
from iniparse import compat as ConfigParser
|
||||||
|
from six import StringIO
|
||||||
|
try:
|
||||||
|
@@ -263,6 +264,8 @@ class mystr(str):
|
||||||
|
|
||||||
|
def test_read_returns_file_list(self):
|
||||||
|
file1 = test_support.findfile("cfgparser.1")
|
||||||
|
+ if not os.path.exists(file1):
|
||||||
|
+ file1 = test_support.findfile("configdata/cfgparser.1")
|
||||||
|
# check when we pass a mix of readable and non-readable files:
|
||||||
|
cf = self.newconfig()
|
||||||
|
parsed_files = cf.read([file1, "nonexistant-file"])
|
@ -16,6 +16,8 @@ URL: https://github.com/candlepin/python-iniparse
|
|||||||
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
|
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
|
||||||
# https://github.com/candlepin/python-iniparse/pull/24
|
# https://github.com/candlepin/python-iniparse/pull/24
|
||||||
Patch6: 0006-Fix-compatibility-issues-with-Python-3.11.patch
|
Patch6: 0006-Fix-compatibility-issues-with-Python-3.11.patch
|
||||||
|
# https://github.com/candlepin/python-iniparse/pull/29
|
||||||
|
Patch7: 0001-Fix-tests-with-python-3.12.1.patch
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user