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.
Gracefully handle lack of
getsitepackages
in thesite
module. Fixes compatibility with early PyInstaller 5.x versions (< 5.4), and future-proofs the hook in case thegetsitepackages
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
isNone
, so it makes sense to add that default value forgetattr
.