File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 22
33import logging
44import os
5- import platform
5+ import distutils . ccompiler
66from configparser import ConfigParser
77from imp import reload
88from pathlib import Path
@@ -156,12 +156,8 @@ def get_module(module_name: str) -> "ModuleType":
156156 FileNotFoundError
157157 if module is not found in directory
158158 """
159- if platform .system () == "Windows" :
160- ext = ".dll"
161- elif platform .system () == "Darwin" :
162- ext = ".dylib"
163- else :
164- ext = ".so"
159+ # https://discuss.python.org/t/how-to-get-the-file-extension-of-dynamic-libraries-for-current-os/3916/5
160+ ext = distutils .ccompiler .new_compiler ().shared_lib_extension
165161
166162 module_file = (
167163 (Path (__file__ ).parent / SHARED_LIB_MODULE / module_name )
You can’t perform that action at this time.
0 commit comments