summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-06-11 08:09:01 +0200
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-06-11 08:09:01 +0200
commit0f7cc48907e1b28e114d37e3bd30a2237d9f6c8c (patch)
treed91e336fae47ffcc3f8090fa44725612346c81d3 /src
parentc04ff4c1f5c6aa7115c2e0e57f5ecc3ebb153fb2 (diff)
cannot import WinDLL from ctypes on non-windows systems
Diffstat (limited to 'src')
-rw-r--r--src/python/gudhi/_distributor_init.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/python/gudhi/_distributor_init.py b/src/python/gudhi/_distributor_init.py
index 0ed451f9..6f3dc8a2 100644
--- a/src/python/gudhi/_distributor_init.py
+++ b/src/python/gudhi/_distributor_init.py
@@ -3,8 +3,6 @@ Helper to preload windows dlls to prevent dll not found errors.
Once a DLL is preloaded, its namespace is made available to any subsequent DLL.
'''
import os
-from ctypes import WinDLL
-import glob
if os.name == 'nt':
# convention for storing / loading the DLL from gudhi/.libs/, if present
try:
@@ -14,5 +12,7 @@ if os.name == 'nt':
else:
libs_dir = os.path.abspath(os.path.join(basedir, '.libs'))
if os.path.isdir(libs_dir):
+ from ctypes import WinDLL
+ import glob
for filename in glob.glob(os.path.join(libs_dir, '*dll')):
WinDLL(os.path.abspath(filename))