hgdemandimport/demandimportpy3.py
changeset 49588 7236f11db0c3
parent 49536 87516dd774d0
child 49845 e0c0545e2e55
--- a/hgdemandimport/demandimportpy3.py	Tue Aug 30 09:59:53 2022 -0400
+++ b/hgdemandimport/demandimportpy3.py	Wed Nov 02 09:34:03 2022 -0400
@@ -41,6 +41,10 @@
         """Make the module load lazily."""
         with tracing.log('demandimport %s', module):
             if _deactivated or module.__name__ in ignores:
+                # Reset the loader on the module as super() does (issue6725)
+                module.__spec__.loader = self.loader
+                module.__loader__ = self.loader
+
                 self.loader.exec_module(module)
             else:
                 super().exec_module(module)