From 745b0b2d83cdbd28fcb4f565b77b31ef6f888350 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 3 Aug 2017 06:33:46 -0500 Subject: [PATCH] Remove try/except block around CDLL --- openmc/capi/__init__.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/openmc/capi/__init__.py b/openmc/capi/__init__.py index 2452da7b11..355304a310 100644 --- a/openmc/capi/__init__.py +++ b/openmc/capi/__init__.py @@ -28,16 +28,11 @@ else: # Open shared library _filename = pkg_resources.resource_filename( __name__, '_libopenmc.{}'.format(_suffix)) -try: - _dll = CDLL(_filename) -except OSError: - warn("OpenMC shared library is not available from the Python API. This " - "means you will not be able to use openmc.capi to make in-memory " - "calls to OpenMC.") -else: - from .error import * - from .core import * - from .nuclide import * - from .material import * - from .cell import * - from .tally import * +_dll = CDLL(_filename) + +from .error import * +from .core import * +from .nuclide import * +from .material import * +from .cell import * +from .tally import *