From 087d2c82fab2c90ac036ae4bd1d9f488465ecde1 Mon Sep 17 00:00:00 2001 From: Kazuya O'moto Date: Sat, 3 May 2025 02:32:56 +0900 Subject: [PATCH] Replace imp with types https://docs.python.org/3.12/library/imp.html --- wx/py/editor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wx/py/editor.py b/wx/py/editor.py index 00323238..b3f9d3a7 100644 --- a/wx/py/editor.py +++ b/wx/py/editor.py @@ -274,8 +274,8 @@ class EditorNotebookFrame(EditorFrame): Called automatically by base class during init.""" self.notebook = EditorNotebook(parent=self) intro = 'Py %s' % version.VERSION - import imp - module = imp.new_module('__main__') + import types + module = types.ModuleType('__main__') module.__dict__['__builtins__'] = __builtins__ namespace = module.__dict__.copy() self.crust = crust.Crust(parent=self.notebook, intro=intro, locals=namespace)