hook-_osx_support.py 1.0 KB

12345678910111213141516171819
  1. #-----------------------------------------------------------------------------
  2. # Copyright (c) 2025, PyInstaller Development Team.
  3. #
  4. # Distributed under the terms of the GNU General Public License (version 2
  5. # or later) with exception for distributing the bootloader.
  6. #
  7. # The full license is in the file COPYING.txt, distributed with this software.
  8. #
  9. # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
  10. #-----------------------------------------------------------------------------
  11. # Prevent conditional import of `distutils` in `_osx_support.compiler_fixup()` in python < 3.10 from pulling in
  12. # `distutils`; this function is called only from `distutils` itself, which ensures that the module is available as
  13. # needed. Blocking this import prevents `distutils` (and nowadays `setuptools`) from being pulled into even very
  14. # basic applications when built with python < 3.10.
  15. #
  16. # See: https://github.com/python/cpython/blob/f3994ade31a563d49806cf6a681d1b1115fccaa3/Lib/_osx_support.py#L430-L434
  17. excludedimports = ['distutils']