diff --git a/.travis.yml b/.travis.yml index 45600a2..81ba29e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,3 +17,7 @@ script: after_success: - coveralls + +branches: + except: + - pythonocc diff --git a/cadquery/freecad_impl/__init__.py b/cadquery/freecad_impl/__init__.py index ac73b1e..3e041e3 100644 --- a/cadquery/freecad_impl/__init__.py +++ b/cadquery/freecad_impl/__init__.py @@ -39,6 +39,7 @@ def _fc_path(): "/usr/lib/freecad/lib", "/opt/freecad/lib/", "/usr/bin/freecad/lib", + "/usr/lib/freecad", ]: if os.path.exists(_PATH): return _PATH @@ -94,5 +95,18 @@ def _fc_path(): if os.path.exists(_PATH): return _PATH + + #Make sure that the correct FreeCAD path shows up in Python's system path -sys.path.insert(0, _fc_path()) +no_library_path = ImportError('cadquery was unable to determine freecads library path') +try: + import FreeCAD +except ImportError: + path = _fc_path() + if path: + sys.path.insert(0, path) + try: + import FreeCAD + except ImportError: + raise no_library_path + else: raise no_library_path diff --git a/changes.md b/changes.md index 77456e4..2445102 100644 --- a/changes.md +++ b/changes.md @@ -38,3 +38,5 @@ v0.1.9 (Unreleased) * Added CQ.sphere operation that mirrors CQ.box * Updated copyright dates * Cleaned up spelling and misc errors in docstrings + * Fixed FreeCAD import error on Arch Linux (thanks @moeb) + * Made FreeCAD import report import error instead of silently failing (thanks @moeb)