exceptions.py 1.1 KB

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