pyinstaller / pyinstaller-hooks-contrib

Community maintained hooks for PyInstaller.
Other
96 stars 126 forks source link

rthooks: tensorflow: gracefully handle lack of getsitepackages in site #791

Closed rokm closed 2 months ago

rokm commented 2 months ago

Gracefully handle lack of getsitepackages in the site module. Fixes compatibility with early PyInstaller 5.x versions (< 5.4), and future-proofs the hook in case the getsitepackages function ever legitimately ends up being unavailable.

Closes #789. While I don't particularly care for compatibility with outdated PyInstaller versions (< 5.4 that are affected), the code in question already tries to handle the case when _orig_getsitepackages is None, so it makes sense to add that default value for getattr.