exceptions.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # --------------------------------------------------------------------------------------
  2. # Copyright (c) 2023, Nucleic Development Team.
  3. #
  4. # Distributed under the terms of the Modified BSD License.
  5. #
  6. # The full license is in the file LICENSE, distributed with this software.
  7. # --------------------------------------------------------------------------------------
  8. """Kiwi exceptions.
  9. Imported by the kiwisolver C extension.
  10. """
  11. class BadRequiredStrength(Exception):
  12. pass
  13. class DuplicateConstraint(Exception):
  14. __slots__ = ("constraint",)
  15. def __init__(self, constraint):
  16. self.constraint = constraint
  17. class DuplicateEditVariable(Exception):
  18. __slots__ = ("edit_variable",)
  19. def __init__(self, edit_variable):
  20. self.edit_variable = edit_variable
  21. class UnknownConstraint(Exception):
  22. __slots__ = ("constraint",)
  23. def __init__(self, constraint):
  24. self.constraint = constraint
  25. class UnknownEditVariable(Exception):
  26. __slots__ = ("edit_variable",)
  27. def __init__(self, edit_variable):
  28. self.edit_variable = edit_variable
  29. class UnsatisfiableConstraint(Exception):
  30. __slots__ = ("constraint",)
  31. def __init__(self, constraint):
  32. self.constraint = constraint