projects/guix·blob ruby-team · refs

60 lines · 1.9 KiB

1Patch itself taken from Debian:
2https://sources.debian.org/data/main/q/qtwebengine-opensource-src/5.15.18%2Bdfsg-2/debian/patches/python3.12-six.patch
3Debian used it until qtwebengine-5.15.19.
4
5Description: implement find_spec() for _SixMetaPathImporter
6Origin: upstream, https://github.com/benjaminp/six/commit/25916292d96f5f09
7Last-Update: 2024-03-17
8
9--- a/src/3rdparty/chromium/third_party/protobuf/third_party/six/six.py
10+++ b/src/3rdparty/chromium/third_party/protobuf/third_party/six/six.py
11@@ -71,6 +71,11 @@ else:
12 MAXSIZE = int((1 << 63) - 1)
13 del X
14
15+if PY34:
16+ from importlib.util import spec_from_loader
17+else:
18+ spec_from_loader = None
19+
20
21 def _add_doc(func, doc):
22 """Add documentation to a function."""
23@@ -186,6 +191,11 @@ class _SixMetaPathImporter(object):
24 return self
25 return None
26
27+ def find_spec(self, fullname, path, target=None):
28+ if fullname in self.known_modules:
29+ return spec_from_loader(fullname, self)
30+ return None
31+
32 def __get_module(self, fullname):
33 try:
34 return self.known_modules[fullname]
35--- a/src/3rdparty/chromium/tools/grit/third_party/six/__init__.py
36+++ b/src/3rdparty/chromium/tools/grit/third_party/six/__init__.py
37@@ -71,6 +71,11 @@ else:
38 MAXSIZE = int((1 << 63) - 1)
39 del X
40
41+if PY34:
42+ from importlib.util import spec_from_loader
43+else:
44+ spec_from_loader = None
45+
46
47 def _add_doc(func, doc):
48 """Add documentation to a function."""
49@@ -186,6 +191,11 @@ class _SixMetaPathImporter(object):
50 return self
51 return None
52
53+ def find_spec(self, fullname, path, target=None):
54+ if fullname in self.known_modules:
55+ return spec_from_loader(fullname, self)
56+ return None
57+
58 def __get_module(self, fullname):
59 try:
60 return self.known_modules[fullname]