From 5fb72128a9f953d7847858fd5a7fea7e85b1b920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Sat, 2 Mar 2024 20:19:54 +0100 Subject: [PATCH] tuir: adjust for python 3.12 method removal --- ...djust-for-python-3.12-method-removal.patch | 49 +++++++++++++++++++ srcpkgs/tuir/template | 3 +- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/tuir/patches/0001-Adjust-for-python-3.12-method-removal.patch diff --git a/srcpkgs/tuir/patches/0001-Adjust-for-python-3.12-method-removal.patch b/srcpkgs/tuir/patches/0001-Adjust-for-python-3.12-method-removal.patch new file mode 100644 index 00000000000000..bd9dc39ec01307 --- /dev/null +++ b/srcpkgs/tuir/patches/0001-Adjust-for-python-3.12-method-removal.patch @@ -0,0 +1,49 @@ +From 02ab9bade680d7c50c7d5988a75ff928ba1a8cbd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= +Date: Fri, 27 Oct 2023 20:54:13 +0200 +Subject: [PATCH 1/7] Adjust for python 3.12 method removal + +--- + tuir/config.py | 7 ++++++- + tuir/theme.py | 7 ++++++- + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/tuir/config.py b/tuir/config.py +index 7a8a4d5..4fea785 100644 +--- a/tuir/config.py ++++ b/tuir/config.py +@@ -131,7 +131,12 @@ class Config(object): + config = configparser.RawConfigParser() + if os.path.exists(filename): + with codecs.open(filename, encoding='utf-8') as fp: +- config.readfp(fp) ++ try: ++ read_method = config.read_file ++ except AttributeError: ++ # deprecated since 3.2, removed in 3.12 ++ read_method = config.readfp ++ read_method(fp) + + return cls._parse_tuir_file(config) + +diff --git a/tuir/theme.py b/tuir/theme.py +index 57b3288..c44b222 100644 +--- a/tuir/theme.py ++++ b/tuir/theme.py +@@ -399,7 +399,12 @@ class Theme(object): + config = configparser.ConfigParser() + config.optionxform = six.text_type # Preserve case + with codecs.open(filename, encoding='utf-8') as fp: +- config.readfp(fp) ++ try: ++ read_method = config.read_file ++ except AttributeError: ++ # deprecated since 3.2, removed in 3.12 ++ read_method = config.readfp ++ read_method(fp) + except configparser.ParsingError as e: + raise ConfigError(e.message) + +-- +2.43.0 + diff --git a/srcpkgs/tuir/template b/srcpkgs/tuir/template index bfae8ff1a64d2a..c431c4cf9b99eb 100644 --- a/srcpkgs/tuir/template +++ b/srcpkgs/tuir/template @@ -1,7 +1,7 @@ # Template file for 'tuir' pkgname=tuir version=1.29.0 -revision=6 +revision=7 build_style=python3-module hostmakedepends="python3-setuptools" depends="ncurses python3-BeautifulSoup4 python3-decorator python3-kitchen @@ -12,6 +12,7 @@ license="MIT" homepage="https://gitlab.com/ajak/tuir" distfiles="${homepage}/-/archive/v${version}/tuir-v${version}.tar.bz2" checksum=501ba4e6b24f20116ccfac39cdf16b6a5c89411b4928371d5c2314d0da57d80d +make_check=no # python3-vcrpy required post_install() { vlicense LICENSE