Skip to content

fix: search also in lib and Lib subdirectories of module dir

Steven Masfaraud requested to merge fix/search-lib into master

I got this error so I figured out that the moduledir was just above the lib folder:

`File ~/.local/lib/python3.9/site-packages/gmsh-4.11.1-py3.9-linux-x86_64.egg/gmsh.py:83 80 libpath = find_library("gmsh") 82 # ... and print a warning if everything failed ---> 83 if not os.path.exists(libpath): 84 print("Warning: could not find Gmsh shared library " + libname) 86 lib = CDLL(libpath)

File /usr/local/lib/python3.9/genericpath.py:19, in exists(path) 17 """Test whether a path exists. Returns False for broken symbolic links""" 18 try: ---> 19 os.stat(path) 20 except (OSError, ValueError): 21 return False

TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

In [2]: moduledir Out[2]: '/home/gmsh/.local/lib/python3.9/site-packages/gmsh-4.11.1-py3.9-linux-x86_64.egg' `

I rewrote the search to make it moreeasy to understand.

Merge request reports