Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Commit

Permalink
Experimental fix for Python3.8 on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gillins committed Jan 16, 2020
1 parent 65e34ff commit a6a1e1e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pylidar/lidarformats/h5space.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,20 @@
import h5py
from numba import jit
import ctypes
from rios.parallel.jobmanager import find_executable

# Need to give ourselves access to H5Sselect_hyperslab()
# within the HDF5 library so we can call it from numba
# Sadly, we also need to cope with not accessing this, in order that ReadTheDocs will still
# be able to build to documentation. Hence the elaborate try/except madness.
try:
if sys.platform == 'win32':
HDF5_DLL = ctypes.CDLL('hdf5.dll')
# Under Python 3.8 and later we must need to know the path to the DLL
# For conda installs we could use $CONDA_PREFIX, but we want this
# to work for all cases and user may have hdf5.dll somewhere weird.
# This breaks the security of the change, but keeps things working....
dllPath = find_executable('hdf5.dll')
HDF5_DLL = ctypes.CDLL(dllPath)
elif sys.platform == 'darwin':
HDF5_DLL = ctypes.CDLL('libhdf5.dylib')
else:
Expand Down

0 comments on commit a6a1e1e

Please sign in to comment.