From 2f450630ad3e02c1b1673a22e1edff5e8b298121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= <inform@tiker.net> Date: Thu, 5 Dec 2019 17:46:20 -0600 Subject: [PATCH] Add a missing error check to _find_pyopencl_include_path --- pyopencl/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py index e24eea20..b7de98df 100644 --- a/pyopencl/__init__.py +++ b/pyopencl/__init__.py @@ -260,13 +260,15 @@ def _find_pyopencl_include_path(): # Try to find the include path in the same directory as this file include_path = join(abspath(dirname(__file__)), "cl") if not exists(include_path): - raise IOError() + raise IOError("unable to find pyopencl include path") except Exception: # Try to find the resource with pkg_resources (the recommended # setuptools approach). This is very slow. from pkg_resources import Requirement, resource_filename include_path = resource_filename( Requirement.parse("pyopencl"), "pyopencl/cl") + if not exists(include_path): + raise IOError("unable to find pyopencl include path") # Quote the path if it contains a space and is not quoted already. # See https://github.com/inducer/pyopencl/issues/250 for discussion. -- GitLab