diff --git a/src/setuptools_dso/dsocmd.py b/src/setuptools_dso/dsocmd.py index e9482e5..44ef178 100644 --- a/src/setuptools_dso/dsocmd.py +++ b/src/setuptools_dso/dsocmd.py @@ -220,7 +220,7 @@ def dso2lib_pre(self, ext): try: # also check if this DSO lives in an external package. for i in range(1, len(parts)): - basepackage = import_module(".".join(parts[0:i])).__file__ + basepackage = getattr(import_module(".".join(parts[0:i])), "__file__", None) if basepackage: dsobase = os.path.dirname(basepackage) if i < len(parts):