summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Sarnie <sarnex@gentoo.org>2023-05-01 21:06:49 -0400
committerNick Sarnie <sarnex@gentoo.org>2023-05-01 21:10:29 -0400
commit993d5771169f5fcfbf0b82ae58db1f28bca1918a (patch)
tree76ee59170d883645d9bf3c6fa0c8e032931e5e65 /media-gfx/displaycal-py3/files
parentapp-emulation/uxn: bump to 0_p20230501 (diff)
downloadgentoo-993d5771169f5fcfbf0b82ae58db1f28bca1918a.tar.gz
gentoo-993d5771169f5fcfbf0b82ae58db1f28bca1918a.tar.bz2
gentoo-993d5771169f5fcfbf0b82ae58db1f28bca1918a.zip
media-gfx/displaycal-py3: Enable python 3.11
Closes: https://bugs.gentoo.org/896984 Signed-off-by: Nick Sarnie <sarnex@gentoo.org>
Diffstat (limited to 'media-gfx/displaycal-py3/files')
-rw-r--r--media-gfx/displaycal-py3/files/displaycal-py3-3.9.10-python-3.11.patch83
1 files changed, 83 insertions, 0 deletions
diff --git a/media-gfx/displaycal-py3/files/displaycal-py3-3.9.10-python-3.11.patch b/media-gfx/displaycal-py3/files/displaycal-py3-3.9.10-python-3.11.patch
new file mode 100644
index 000000000000..d8e7d05abfb4
--- /dev/null
+++ b/media-gfx/displaycal-py3/files/displaycal-py3-3.9.10-python-3.11.patch
@@ -0,0 +1,83 @@
+Based on
+https://github.com/eoyilmaz/displaycal-py3/commit/3762e7be0368484d68c4a90923672fdb0f51a5fc
+and
+https://github.com/eoyilmaz/displaycal-py3/commit/97f0c91f5855e4d21f47181ef596251eb03cb835
+
+diff --git a/DisplayCAL/RealDisplaySizeMM.py b/DisplayCAL/RealDisplaySizeMM.py
+index 00957692c..25b730d05 100644
+--- a/DisplayCAL/RealDisplaySizeMM.py
++++ b/DisplayCAL/RealDisplaySizeMM.py
+@@ -25,6 +25,8 @@
+ from DisplayCAL.lib64.python39.RealDisplaySizeMM import *
+ elif sys.version_info[:2] == (3, 10):
+ from DisplayCAL.lib64.python310.RealDisplaySizeMM import *
++ elif sys.version_info[:2] == (3, 11):
++ from DisplayCAL.lib64.python311.RealDisplaySizeMM import *
+ # else:
+ # pass
+
+diff --git a/DisplayCAL/defaultpaths.py b/DisplayCAL/defaultpaths.py
+index cd11d6d75..59258e79d 100644
+--- a/DisplayCAL/defaultpaths.py
++++ b/DisplayCAL/defaultpaths.py
+@@ -235,9 +235,14 @@ def set_translation(obj):
+ obj.GETTEXT_PACKAGE, locale_dir, codeset="UTF-8"
+ )
+ except TypeError:
+- obj.translation = gettext.translation(
+- obj.GETTEXT_PACKAGE, locale_dir
+- )
++ try:
++ obj.translation = gettext.translation(
++ obj.GETTEXT_PACKAGE, locale_dir
++ )
++ except FileNotFoundError as exc:
++ print("XDG:", exc)
++ obj.translation = gettext.NullTranslations()
++ return False
+ except IOError as exception:
+ print("XDG:", exception)
+ obj.translation = gettext.NullTranslations()
+@@ -261,11 +266,7 @@ def get_config_files(filename):
+
+ @staticmethod
+ def shell_unescape(s):
+- a = []
+- for i, c in enumerate(s):
+- if c == "\\" and len(s) > i + 1:
+- continue
+- a.append(c)
++ a = [c for i, c in enumerate(s) if c != "\\" or len(s) <= i + 1]
+ return "".join(a)
+
+ @staticmethod
+diff --git a/DisplayCAL/lib64/python311/__init__.py b/DisplayCAL/lib64/python311/__init__.py
+new file mode 100644
+index 000000000..e69de29bb
+diff --git a/README.md b/README.md
+index 3ff3c4ec4..4119ace70 100644
+--- a/README.md
++++ b/README.md
+@@ -25,7 +25,7 @@ Here is a screenshots showing the tool working with Python 3.10:
+
+ ![image](https://user-images.githubusercontent.com/1786804/169152229-e06ff549-55fe-4149-8742-405446e6b01f.png)
+
+-Currently, DisplayCAL is working with Python 3.8, 3.9 and 3.10 and wxPython 4.1.1 or 4.2.0.
++Currently, DisplayCAL is working with Python 3.8, 3.9, 3.10 and 3.11 and wxPython 4.1.1 or 4.2.0.
+
+ Here is a list of things that is working:
+
+
+diff --git a/DisplayCAL/meta.py b/DisplayCAL/meta.py
+index 00b9c82c..30797cdf 100644
+--- a/DisplayCAL/meta.py
++++ b/DisplayCAL/meta.py
+@@ -62,7 +62,7 @@
+ name_html = '<span class="appname">Display<span>CAL</span></span>'
+
+ py_minversion = (3, 8)
+-py_maxversion = (3, 10)
++py_maxversion = (3, 11)
+
+ version = VERSION_STRING
+ version_lin = VERSION_STRING # Linux