1 /** 2 * Copyright 2021-2022 Huawei Technologies Co., Ltd 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 #ifndef PYBIND_API_PYBIND_PATCH_H_ 17 #define PYBIND_API_PYBIND_PATCH_H_ 18 19 namespace pybind11 { 20 PYBIND11_RUNTIME_EXCEPTION(attribute_error, PyExc_AttributeError) 21 PYBIND11_RUNTIME_EXCEPTION(name_error, PyExc_NameError) 22 PYBIND11_RUNTIME_EXCEPTION(assertion_error, PyExc_AssertionError) 23 PYBIND11_RUNTIME_EXCEPTION(base_exception, PyExc_BaseException) 24 PYBIND11_RUNTIME_EXCEPTION(keyboard_interrupt, PyExc_KeyboardInterrupt) 25 PYBIND11_RUNTIME_EXCEPTION(overflow_error, PyExc_OverflowError) 26 PYBIND11_RUNTIME_EXCEPTION(zero_division_error, PyExc_ZeroDivisionError) 27 PYBIND11_RUNTIME_EXCEPTION(environment_error, PyExc_EnvironmentError) 28 PYBIND11_RUNTIME_EXCEPTION(io_error, PyExc_IOError) 29 PYBIND11_RUNTIME_EXCEPTION(os_error, PyExc_OSError) 30 PYBIND11_RUNTIME_EXCEPTION(memory_error, PyExc_MemoryError) 31 PYBIND11_RUNTIME_EXCEPTION(unbound_local_error, PyExc_UnboundLocalError) 32 PYBIND11_RUNTIME_EXCEPTION(not_implemented_error, PyExc_NotImplementedError) 33 PYBIND11_RUNTIME_EXCEPTION(indentation_error, PyExc_IndentationError) 34 PYBIND11_RUNTIME_EXCEPTION(runtime_warning, PyExc_RuntimeWarning) 35 } // namespace pybind11 36 37 #endif // PYBIND_API_PYBIND_PATCH_H_ 38