summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/bottle/files/bottle-0.12.25-py312.patch')
-rw-r--r--dev-python/bottle/files/bottle-0.12.25-py312.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/dev-python/bottle/files/bottle-0.12.25-py312.patch b/dev-python/bottle/files/bottle-0.12.25-py312.patch
new file mode 100644
index 000000000000..717463841af5
--- /dev/null
+++ b/dev-python/bottle/files/bottle-0.12.25-py312.patch
@@ -0,0 +1,35 @@
+From ca6762c559c5e71e0dff71dc97eb4c6b3ed9bbcd Mon Sep 17 00:00:00 2001
+From: Marcel Hellkamp <marc@gsites.de>
+Date: Sun, 12 Jun 2022 15:15:35 +0200
+Subject: [PATCH] Fix #1378: Module loader should move from find_mdoule to
+ find_spec.
+
+---
+ bottle.py | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/bottle.py b/bottle.py
+index 8e7e3d7..63e55cf 100755
+--- a/bottle.py
++++ b/bottle.py
+@@ -2068,10 +2068,15 @@ class _ImportRedirect(object):
+ })
+ sys.meta_path.append(self)
+
++ def find_spec(self, fullname, path, target=None):
++ if '.' not in fullname: return
++ if fullname.rsplit('.', 1)[0] != self.name: return
++ from importlib.util import spec_from_loader
++ return spec_from_loader(fullname, self)
++
+ def find_module(self, fullname, path=None):
+ if '.' not in fullname: return
+- packname = fullname.rsplit('.', 1)[0]
+- if packname != self.name: return
++ if fullname.rsplit('.', 1)[0] != self.name: return
+ return self
+
+ def load_module(self, fullname):
+--
+2.40.1
+