================ @@ -152,6 +152,41 @@ def b(x: str | bytes) -> bytes: ### Exception Classes ### +class CXError(Exception): + '''Represents C error of type enum CXErrorCode.''' + + # A generic error code, no further details are available. + # + # Errors of this kind can get their own specific error codes in future + # libclang versions. + ERROR_FAILURE = 1 + + # libclang crashed while performing the requested operation. + ERROR_CRASHED = 2 + + # The function detected that the arguments violate the function + # contract. + ERROR_INVALID_ARGUMENTS = 3 + + # An AST deserialization error has occurred. + ERROR_AST_READ_ERROR = 4 + + error_code: int ---------------- DeinAlptraum wrote:
The type hint shouldn't be necessary, as the instance variable is initialized with an annotated type in the `__init__` https://github.com/llvm/llvm-project/pull/102410 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits