Permalink
Browse files

Merge pull request #62 from yarikoptic/master

setup.py:  not crash when mayavi2 4.0.0 (without enthought. namespace) is available
  • Loading branch information...
2 parents 3a7c65d + 178d22c commit 2c11ae604762105a4adaa46c57e95dc1998485eb @yarikoptic yarikoptic committed Jul 20, 2011
Showing with 12 additions and 2 deletions.
  1. +12 −2 setup.py
View
@@ -59,8 +59,18 @@ def configuration(parent_package='',top_path=None):
package_check('nibabel', INFO_VARS['NIBABEL_MIN_VERSION'])
package_check('sympy', INFO_VARS['SYMPY_MIN_VERSION'])
def _mayavi_version(pkg_name):
- from enthought.mayavi import version
- return version.version
+ """Mayavi2 pruned enthought. namespace at 4.0.0
+ """
+ v = ''
+ try:
+ from mayavi import version
+ v = version.version
+ if v == '':
+ v = '4.0.0' # must be the one in Debian
+ except ImportError:
+ from enthought.mayavi import version
+ v = version.version
+ return v
package_check('mayavi',
INFO_VARS['MAYAVI_MIN_VERSION'],
optional=True,

0 comments on commit 2c11ae6

Please sign in to comment.