| 1 | Patch itself taken from Debian:
|
| 2 | https://sources.debian.org/data/main/q/qtwebengine-opensource-src/5.15.18%2Bdfsg-2/debian/patches/python3.12-six.patch
|
| 3 | Debian used it until qtwebengine-5.15.19.
|
| 4 |
|
| 5 | Description: implement find_spec() for _SixMetaPathImporter
|
| 6 | Origin: upstream, https://github.com/benjaminp/six/commit/25916292d96f5f09
|
| 7 | Last-Update: 2024-03-17
|
| 8 |
|
| 9 | |
| 10 | |
| 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 | |
| 36 | |
| 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]
|