File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 1+ import importlib .util
12import os
23
34try :
1112USER_DATA_PATH = None
1213LOCAL_DOWNLOADED_EXAMPLES_PATH = None
1314try :
14- import pkgutil
15-
16- spec = pkgutil .get_loader (__name__ )
17- USER_DATA_PATH = os .path .dirname (spec .get_filename (__name__ ))
15+ spec = importlib .util .find_spec (name = __name__ )
16+ USER_DATA_PATH = os .path .dirname (spec .origin )
1817 if not os .path .exists (USER_DATA_PATH ): # pragma: no cover
1918 os .makedirs (USER_DATA_PATH )
2019
2120 LOCAL_DOWNLOADED_EXAMPLES_PATH = os .path .join (USER_DATA_PATH , "examples" )
2221 if not os .path .exists (LOCAL_DOWNLOADED_EXAMPLES_PATH ): # pragma: no cover
2322 os .makedirs (LOCAL_DOWNLOADED_EXAMPLES_PATH )
24- except : # pragma: no cover
25- pass
23+ except Exception as e : # pragma: no cover
24+ raise e
2625
2726installed = [d .metadata ["Name" ] for d in importlib_metadata .distributions ()]
2827check_for = ["ansys-dpf-gatebin" , "ansys-dpf-gate" , "ansys-grpc-dpf" ]
You can’t perform that action at this time.
0 commit comments