From 328f7219cf055c8dfea92ce00cc313e426dcdbe1 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Tue, 16 Nov 2021 17:16:26 +0100 Subject: [PATCH] Backport another fix for compatibility with Python 3.10 (#2023682) --- 121.patch | 46 ++++++++++++++++++++++++++++++++++++++++++++++ orca.spec | 9 ++++++++- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 121.patch diff --git a/121.patch b/121.patch new file mode 100644 index 0000000..2cfa66e --- /dev/null +++ b/121.patch @@ -0,0 +1,46 @@ +From cea2bebdbd9fd69561945d191d9d44beeef655cc Mon Sep 17 00:00:00 2001 +From: Valentin Villenave +Date: Mon, 15 Nov 2021 14:45:02 +0100 +Subject: [PATCH] modify collections module import for Python3.10 compatibility + +--- + src/orca/generator.py | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/orca/generator.py b/src/orca/generator.py +index 2058a436d..a7ff8f856 100644 +--- a/src/orca/generator.py ++++ b/src/orca/generator.py +@@ -27,7 +27,6 @@ __copyright__ = "Copyright (c) 2009 Sun Microsystems Inc." \ + "Copyright (c) 2015-2016 Igalia, S.L." + __license__ = "LGPL" + +-import collections + import pyatspi + import sys + import time +@@ -41,6 +40,12 @@ from . import object_properties + from . import settings + from . import settings_manager + ++# Python 3.10 compatibility: ++try: ++ import collections.abc as collections_abc ++except ImportError: ++ import collections as collections_abc ++ + def _formatExceptionInfo(maxTBlevel=5): + cla, exc, trbk = sys.exc_info() + excName = cla.__name__ +@@ -78,7 +83,7 @@ class Generator: + self._activeProgressBars = {} + self._methodsDict = {} + for method in \ +- [z for z in [getattr(self, y).__get__(self, self.__class__) for y in [x for x in dir(self) if x.startswith(METHOD_PREFIX)]] if isinstance(z, collections.abc.Callable)]: ++ [z for z in [getattr(self, y).__get__(self, self.__class__) for y in [x for x in dir(self) if x.startswith(METHOD_PREFIX)]] if isinstance(z, collections_abc.Callable)]: + name = method.__name__[len(METHOD_PREFIX):] + name = name[0].lower() + name[1:] + self._methodsDict[name] = method +-- +GitLab + diff --git a/orca.spec b/orca.spec index 9b83e95..1bc95a7 100644 --- a/orca.spec +++ b/orca.spec @@ -2,13 +2,17 @@ Name: orca Version: 41.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Assistive technology for people with visual impairments License: LGPLv2+ URL: https://wiki.gnome.org/Projects/Orca Source0: https://download.gnome.org/sources/%{name}/41/%{name}-%{tarball_version}.tar.xz +# Backported from upstream +# https://gitlab.gnome.org/GNOME/orca/-/merge_requests/121 +Patch0: 121.patch + BuildArch: noarch BuildRequires: pkgconfig(atk-bridge-2.0) @@ -76,6 +80,9 @@ desktop-file-validate %{buildroot}%{_sysconfdir}/xdg/autostart/orca-autostart.de %changelog +* Tue Nov 16 2021 Kalev Lember - 41.0-2 +- Backport another fix for compatibility with Python 3.10 (#2023682) + * Thu Sep 16 2021 Kalev Lember - 41.0-1 - Update to 41.0