Skip to content

Commit

Permalink
Fix build_py.__getattr__ return type on Python 3.12+
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Jan 21, 2025
1 parent c9eaa26 commit 8eadd7a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion setuptools/command/build_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def run(self) -> None:
# output files are.
self.byte_compile(orig.build_py.get_outputs(self, include_bytecode=False))

def __getattr__(self, attr: str) -> list[tuple[str, str, str, list[str]]] | Any:
# Should return "list[tuple[str, str, str, list[str]]] | Any" but can't do without typed distutils on Python 3.12+
def __getattr__(self, attr: str) -> Any:
"lazily compute data files"
if attr == 'data_files':
self.data_files = self._get_data_files()
Expand Down

0 comments on commit 8eadd7a

Please sign in to comment.