python-lxml/c6b7e621e4.patch

25 lines
992 B
Diff

From c6b7e621e4696c02bf8f6ea423ffbbf2109748ab Mon Sep 17 00:00:00 2001
From: Stefan Behnel <stefan_ml@behnel.de>
Date: Thu, 11 May 2023 10:30:15 +0200
Subject: [PATCH] Avoid using the deprecated "imp" module.
Closes https://bugs.launchpad.net/lxml/+bug/2018137
---
src/lxml/html/tests/test_html5parser.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/lxml/html/tests/test_html5parser.py b/src/lxml/html/tests/test_html5parser.py
index bcf7f1b12..57878a5e3 100644
--- a/src/lxml/html/tests/test_html5parser.py
+++ b/src/lxml/html/tests/test_html5parser.py
@@ -44,7 +44,8 @@ def find_module(self, fullname, path=None):
return None
def load_module(self, fullname):
- fake_module = object()
+ class Cls: pass
+ fake_module = Cls()
fake_module.__qualname__ = fullname
fake_module.__name__ = fullname.rsplit('.', 1)[-1]
mod = sys.modules.setdefault(fullname, fake_module)