hook-tkinter.py 834 B

123456789101112131415161718192021
  1. #-----------------------------------------------------------------------------
  2. # Copyright (c) 2024, 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. from PyInstaller import log as logging
  12. from PyInstaller.utils.hooks import tcl_tk
  13. logger = logging.getLogger(__name__)
  14. def pre_find_module_path(hook_api):
  15. if not tcl_tk.tcltk_info.available:
  16. logger.warning("tkinter installation is broken. It will be excluded from the application")
  17. hook_api.search_dirs = []