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