Skip to content

Commit

Permalink
In old Python versions there is no __file__ on namespace packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Thf772 committed Oct 3, 2023
1 parent d45b178 commit 13985a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/setuptools_dso/dsocmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 13985a4

Please sign in to comment.