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

Skip to content

Commit 70d358c

Browse files
committed
Fix erroneous message when wxPython devel headers are not even needed.
svn path=/trunk/matplotlib/; revision=3657
1 parent 616aa83 commit 70d358c

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

setupext.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def add_ft2font_flags(module):
373373
p = os.path.join(d, 'freetype2/lib')
374374
if os.path.exists(p): module.library_dirs.append(p)
375375

376-
module.libraries.append('z')
376+
module.libraries.append('z')
377377
add_base_flags(module)
378378

379379
if sys.platform == 'win32' and win32_compiler == 'mingw32':
@@ -470,7 +470,10 @@ def check_for_wx():
470470
except ImportError:
471471
explanation = 'wxPython not found'
472472
else:
473-
if sys.platform == 'win32' and win32_compiler == 'mingw32':
473+
if getattr(wx, '__version__', '0.0')[0:3] >= '2.8':
474+
print_status("wxPython", wx.__version__)
475+
return True
476+
elif sys.platform == 'win32' and win32_compiler == 'mingw32':
474477
explanation = "The wxAgg extension can not be built using the mingw32 compiler on Windows, since the default wxPython binary is built using MS Visual Studio"
475478
else:
476479
wxconfig = find_wx_config()
@@ -491,15 +494,14 @@ def check_for_wx():
491494
gotit = True
492495

493496
if gotit:
494-
if getattr(wx, '__version__', '0.0')[0:3] < '2.8':
495-
module = Extension("test", [])
496-
add_wx_flags(module, wxconfig)
497-
if not find_include_file(
498-
module.include_dirs,
499-
os.path.join("wx", "wxPython", "wxPython.h")):
500-
explanation = ("Could not find wxPython headers in any of %s" %
497+
module = Extension("test", [])
498+
add_wx_flags(module, wxconfig)
499+
if not find_include_file(
500+
module.include_dirs,
501+
os.path.join("wx", "wxPython", "wxPython.h")):
502+
explanation = ("Could not find wxPython headers in any of %s" %
501503
", ".join(["'%s'" % x for x in module.include_dirs]))
502-
gotit = False
504+
gotit = False
503505

504506
if gotit:
505507
print_status("wxPython", wx.__version__)

0 commit comments

Comments
 (0)