diff --git a/python/__init__.py b/python/__init__.py index d3611217..4babe197 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -1,5 +1,6 @@ from os import environ from sys import path +from sys import platform as _platform path.append(environ['NETGENDIR']+'/../lib') del environ diff --git a/python/csg.py b/python/csg.py index 18acbf68..9fd41225 100644 --- a/python/csg.py +++ b/python/csg.py @@ -1,8 +1,9 @@ -try: - # Linux +from netgen import _platform +if _platform.startswith('linux') or _platform.startswith('darwin'): + # Linux or Mac OS X from libcsg.csg import * from libmesh.meshing import * -except: +if _platform.startswith('win'): # Windows from nglib.csg import * from nglib.meshing import * diff --git a/python/meshing.py b/python/meshing.py index f581ee83..2c8e79ab 100644 --- a/python/meshing.py +++ b/python/meshing.py @@ -1,6 +1,7 @@ -try: - # Linux +from netgen import _platform +if _platform.startswith('linux') or _platform.startswith('darwin'): + # Linux or Mac OS X from libmesh.meshing import * -except: +if _platform.startswith('win'): # Windows from nglib.meshing import *