##// END OF EJS Templates
Fix wx deprecation warning
fperez -
r549:1d3da0d2
parent child
Show More
@@ -4,7 +4,7
4 All the matplotlib support code was co-developed with John Hunter,
4 All the matplotlib support code was co-developed with John Hunter,
5 matplotlib's author.
5 matplotlib's author.
6
6
7 $Id: Shell.py 2120 2007-02-27 15:48:24Z fperez $"""
7 $Id: Shell.py 2151 2007-03-18 01:17:00Z fperez $"""
8
8
9 #*****************************************************************************
9 #*****************************************************************************
10 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
10 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
@@ -555,8 +555,14 def hijack_wx():
555 """
555 """
556 def dummy_mainloop(*args, **kw):
556 def dummy_mainloop(*args, **kw):
557 pass
557 pass
558 import wxPython
558
559 ver = wxPython.__version__
559 try:
560 import wx
561 except ImportError:
562 # For very old versions of WX
563 import wxPython as wx
564
565 ver = wx.__version__
560 orig_mainloop = None
566 orig_mainloop = None
561 if ver[:3] >= '2.5':
567 if ver[:3] >= '2.5':
562 import wx
568 import wx
@@ -566,8 +572,8 def hijack_wx():
566 orig_mainloop = core.PyApp_MainLoop
572 orig_mainloop = core.PyApp_MainLoop
567 core.PyApp_MainLoop = dummy_mainloop
573 core.PyApp_MainLoop = dummy_mainloop
568 elif ver[:3] == '2.4':
574 elif ver[:3] == '2.4':
569 orig_mainloop = wxPython.wxc.wxPyApp_MainLoop
575 orig_mainloop = wx.wxc.wxPyApp_MainLoop
570 wxPython.wxc.wxPyApp_MainLoop = dummy_mainloop
576 wx.wxc.wxPyApp_MainLoop = dummy_mainloop
571 else:
577 else:
572 warn("Unable to find either wxPython version 2.4 or >= 2.5.")
578 warn("Unable to find either wxPython version 2.4 or >= 2.5.")
573 return orig_mainloop
579 return orig_mainloop
@@ -1,3 +1,9
1 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
2
3 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
4 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
5 a report by Nik Tautenhahn.
6
1 2007-03-16 Walter Doerwald <walter@livinglogic.de>
7 2007-03-16 Walter Doerwald <walter@livinglogic.de>
2
8
3 * setup.py: Add the igrid help files to the list of data files
9 * setup.py: Add the igrid help files to the list of data files
General Comments 0
You need to be logged in to leave comments. Login now