From 1d3da0d2438ff54e6eea793c41022489c0d0847e 2007-03-18 01:17:00 From: fperez Date: 2007-03-18 01:17:00 Subject: [PATCH] Fix wx deprecation warning --- diff --git a/IPython/Shell.py b/IPython/Shell.py index 55685d2..1ff03f0 100644 --- a/IPython/Shell.py +++ b/IPython/Shell.py @@ -4,7 +4,7 @@ All the matplotlib support code was co-developed with John Hunter, matplotlib's author. -$Id: Shell.py 2120 2007-02-27 15:48:24Z fperez $""" +$Id: Shell.py 2151 2007-03-18 01:17:00Z fperez $""" #***************************************************************************** # Copyright (C) 2001-2006 Fernando Perez @@ -555,8 +555,14 @@ def hijack_wx(): """ def dummy_mainloop(*args, **kw): pass - import wxPython - ver = wxPython.__version__ + + try: + import wx + except ImportError: + # For very old versions of WX + import wxPython as wx + + ver = wx.__version__ orig_mainloop = None if ver[:3] >= '2.5': import wx @@ -566,8 +572,8 @@ def hijack_wx(): orig_mainloop = core.PyApp_MainLoop core.PyApp_MainLoop = dummy_mainloop elif ver[:3] == '2.4': - orig_mainloop = wxPython.wxc.wxPyApp_MainLoop - wxPython.wxc.wxPyApp_MainLoop = dummy_mainloop + orig_mainloop = wx.wxc.wxPyApp_MainLoop + wx.wxc.wxPyApp_MainLoop = dummy_mainloop else: warn("Unable to find either wxPython version 2.4 or >= 2.5.") return orig_mainloop diff --git a/doc/ChangeLog b/doc/ChangeLog index 9ea490b..9390e57 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2007-03-17 Fernando Perez + + * IPython/Shell.py (hijack_wx): ipmort WX with current semantics + to quiet a deprecation warning that fires with Wx 2.8. Thanks to + a report by Nik Tautenhahn. + 2007-03-16 Walter Doerwald * setup.py: Add the igrid help files to the list of data files