diff --git a/cadquery/freecad_impl/__init__.py b/cadquery/freecad_impl/__init__.py index 46d6c64..338bcea 100644 --- a/cadquery/freecad_impl/__init__.py +++ b/cadquery/freecad_impl/__init__.py @@ -96,10 +96,17 @@ def _fc_path(): return _PATH + +#Make sure that the correct FreeCAD path shows up in Python's system path +no_library_path = ImportError('cadquery was unable to determine freecads library path') try: import FreeCAD except ImportError: - #Make sure that the correct FreeCAD path shows up in Python's system path path = _fc_path() - if path: sys.path.insert(0, _fc_path()) - else: raise ImportError('cadquery was unable to determine freecads library path') + if path: + sys.path.insert(0, _fc_path()) + try: + import FreeCAD + except ImportError: + raise no_library_path + else: raise no_library_path