Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6805ed7

Browse files
committed
Add warnings when using Wx or Gtk backend under Python 3.x
1 parent 6c83a15 commit 6805ed7

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

lib/matplotlib/backends/backend_gtk.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
from __future__ import division, print_function
22

3-
import os, sys
3+
import os, sys, warnings
44
def fn_name(): return sys._getframe(1).f_code.co_name
55

6+
if sys.version_info[0] >= 3:
7+
warnings.warn(
8+
"The gtk* backends have not been tested with Python 3.x",
9+
ImportWarning)
10+
611
try:
712
import gobject
813
import gtk; gdk = gtk.gdk

lib/matplotlib/backends/backend_wx.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
import traceback, pdb
3737
_DEBUG_lvls = {1 : 'Low ', 2 : 'Med ', 3 : 'High', 4 : 'Error' }
3838

39+
if sys.version_info[0] >= 3:
40+
warnings.warn(
41+
"The wx and wxagg backends have not been tested with Python 3.x",
42+
ImportWarning)
43+
3944
missingwx = "Matplotlib backend_wx and backend_wxagg require wxPython >=2.8"
4045

4146
if not hasattr(sys, 'frozen'): # i.e., not py2exe

0 commit comments

Comments
 (0)