From 98c57e3202e618ceb98a3548a351e0c67fff1843 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Thu, 2 Oct 2014 11:10:40 +0000 Subject: [PATCH] os test --- python/__init__.py | 1 + python/csg.py | 7 ++++--- python/meshing.py | 7 ++++--- 3 files changed, 9 insertions(+), 6 deletions(-) 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 *