mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-06 20:10:08 +01:00
Merge pull request #1779 from carandraug/1778-fix-eventwatcher-import
EventWatcher: fix __import__ usage by replacing it with importlib (cl…
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
A widget and supporting classes for watching the events sent to some other widget.
|
||||
"""
|
||||
|
||||
import importlib
|
||||
|
||||
import wx
|
||||
from wx.lib.mixins.listctrl import CheckListCtrlMixin
|
||||
|
||||
@@ -396,9 +398,7 @@ class EventWatcher(wx.Frame):
|
||||
if dlg.ShowModal() == wx.ID_OK:
|
||||
modname = dlg.GetValue()
|
||||
try:
|
||||
# Passing a non-empty fromlist will cause __import__ to
|
||||
# return the imported submodule if a dotted name is passed.
|
||||
module = __import__(modname, fromlist=[0])
|
||||
module = importlib.import_module(modname)
|
||||
except ImportError:
|
||||
wx.MessageBox("Unable to import \"%s\"" % modname,
|
||||
"Error")
|
||||
|
||||
Reference in New Issue
Block a user