diff --git a/Lib/python/std_except.i b/Lib/python/std_except.i index af812d8b0..690224979 100644 --- a/Lib/python/std_except.i +++ b/Lib/python/std_except.i @@ -5,6 +5,21 @@ #include %} +namespace std { + /* Mark all of them as exception classes */ + %feature("exceptionclass") exception; + %feature("exceptionclass") bad_exception; + %feature("exceptionclass") logic_error; + %feature("exceptionclass") domain_error; + %feature("exceptionclass") invalid_argument; + %feature("exceptionclass") length_error; + %feature("exceptionclass") out_of_range; + %feature("exceptionclass") runtime_error; + %feature("exceptionclass") range_error; + %feature("exceptionclass") overflow_error; + %feature("exceptionclass") underflow_error; +} + namespace std { struct exception { @@ -18,46 +33,47 @@ namespace std { struct logic_error : exception { - explicit logic_error(const string& msg); + logic_error(const string& msg); }; struct domain_error : logic_error { - explicit domain_error(const string& msg); + domain_error(const string& msg); }; struct invalid_argument : logic_error { - explicit invalid_argument(const string& msg); + invalid_argument(const string& msg); }; struct length_error : logic_error { - explicit length_error(const string& msg); + length_error(const string& msg); }; struct out_of_range : logic_error { - explicit out_of_range(const string& msg); + out_of_range(const string& msg); }; struct runtime_error : exception { - explicit runtime_error(const string& msg); + runtime_error(const string& msg); }; struct range_error : runtime_error { - explicit range_error(const string& msg); + range_error(const string& msg); }; struct overflow_error : runtime_error { - explicit overflow_error(const string& msg); + overflow_error(const string& msg); }; struct underflow_error : runtime_error { - explicit underflow_error(const string& msg); + underflow_error(const string& msg); }; } +