upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / displaycal / trunk / 3762e7be.patch
blobc516b499712c113927f53af011a704e280e44a44
1 From 3762e7be0368484d68c4a90923672fdb0f51a5fc Mon Sep 17 00:00:00 2001
2 From: Patrick Zwerschke <patrick@p5k.org>
3 Date: Tue, 6 Dec 2022 03:41:27 +0100
4 Subject: [PATCH] Update test workflow for python 3.11 (#215)
6 - added python 3.11 to test workflow
7 - catch FileNotFoundError in module defaultpaths
8 ---
9 .github/workflows/pytest.yml | 10 +++++++---
10 DisplayCAL/RealDisplaySizeMM.py | 2 ++
11 DisplayCAL/defaultpaths.py | 17 +++++++++--------
12 DisplayCAL/lib64/python311/__init__.py | 0
13 README.md | 2 +-
14 5 files changed, 19 insertions(+), 12 deletions(-)
15 create mode 100644 DisplayCAL/lib64/python311/__init__.py
17 diff --git a/DisplayCAL/RealDisplaySizeMM.py b/DisplayCAL/RealDisplaySizeMM.py
18 index 00957692c..25b730d05 100644
19 --- a/DisplayCAL/RealDisplaySizeMM.py
20 +++ b/DisplayCAL/RealDisplaySizeMM.py
21 @@ -25,6 +25,8 @@
22 from DisplayCAL.lib64.python39.RealDisplaySizeMM import *
23 elif sys.version_info[:2] == (3, 10):
24 from DisplayCAL.lib64.python310.RealDisplaySizeMM import *
25 + elif sys.version_info[:2] == (3, 11):
26 + from DisplayCAL.lib64.python311.RealDisplaySizeMM import *
27 # else:
28 # pass
30 diff --git a/DisplayCAL/defaultpaths.py b/DisplayCAL/defaultpaths.py
31 index cd11d6d75..59258e79d 100644
32 --- a/DisplayCAL/defaultpaths.py
33 +++ b/DisplayCAL/defaultpaths.py
34 @@ -235,9 +235,14 @@ def set_translation(obj):
35 obj.GETTEXT_PACKAGE, locale_dir, codeset="UTF-8"
37 except TypeError:
38 - obj.translation = gettext.translation(
39 - obj.GETTEXT_PACKAGE, locale_dir
40 - )
41 + try:
42 + obj.translation = gettext.translation(
43 + obj.GETTEXT_PACKAGE, locale_dir
44 + )
45 + except FileNotFoundError as exc:
46 + print("XDG:", exc)
47 + obj.translation = gettext.NullTranslations()
48 + return False
49 except IOError as exception:
50 print("XDG:", exception)
51 obj.translation = gettext.NullTranslations()
52 @@ -261,11 +266,7 @@ def get_config_files(filename):
54 @staticmethod
55 def shell_unescape(s):
56 - a = []
57 - for i, c in enumerate(s):
58 - if c == "\\" and len(s) > i + 1:
59 - continue
60 - a.append(c)
61 + a = [c for i, c in enumerate(s) if c != "\\" or len(s) <= i + 1]
62 return "".join(a)
64 @staticmethod
65 diff --git a/DisplayCAL/lib64/python311/__init__.py b/DisplayCAL/lib64/python311/__init__.py
66 new file mode 100644
67 index 000000000..e69de29bb
68 diff --git a/README.md b/README.md
69 index 3ff3c4ec4..4119ace70 100644
70 --- a/README.md
71 +++ b/README.md
72 @@ -25,7 +25,7 @@ Here is a screenshots showing the tool working with Python 3.10:
74 ![image](https://user-images.githubusercontent.com/1786804/169152229-e06ff549-55fe-4149-8742-405446e6b01f.png)
76 -Currently, DisplayCAL is working with Python 3.8, 3.9 and 3.10 and wxPython 4.1.1 or 4.2.0.
77 +Currently, DisplayCAL is working with Python 3.8, 3.9, 3.10 and 3.11 and wxPython 4.1.1 or 4.2.0.
79 Here is a list of things that is working: