Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions openmc/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,12 @@
"""

from ctypes import CDLL, c_bool, c_int
import importlib.resources
import os
import sys


# Determine shared-library suffix
if sys.platform == 'darwin':
_suffix = 'dylib'
else:
_suffix = 'so'

if os.environ.get('READTHEDOCS', None) != 'True':
# Open shared library
_filename = importlib.resources.files(__name__) / f'libopenmc.{_suffix}'
import openmc
_filename = openmc.lib[0]
_dll = CDLL(str(_filename)) # TODO: Remove str() when Python 3.12+
else:
# For documentation builds, we don't actually have the shared library
Expand Down