exceptions.py 1.1 KB

1234567891011121314151617181920212223242526272829
  1. #-----------------------------------------------------------------------------
  2. # Copyright (c) 2005-2021, 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. class ExecCommandFailed(SystemExit):
  12. pass
  13. class HookError(Exception):
  14. """Base class for hook related errors."""
  15. pass
  16. class ImportErrorWhenRunningHook(HookError):
  17. def __str__(self):
  18. return ("Failed to import module {0} required by hook for module {1}. "
  19. "Please check whether module {0} actually exists and whether "
  20. "the hook is compatible with your version of {1}: You might "
  21. "want to read more about hooks in the manual and provide "
  22. "a pull-request to improve PyInstaller.".format(
  23. self.args[0], self.args[1]))