py: Removed some unnecessary exception objects.

They still exist in commented-out form in objexcept.c if they are ever
needed.
This commit is contained in:
Damien George
2014-03-25 14:29:40 +00:00
parent caac542b23
commit ffb5cfc8d8
5 changed files with 110 additions and 151 deletions

View File

@@ -96,7 +96,7 @@ const mp_obj_type_t mp_type_ ## exc_name = { \
// List of all exceptions, arranged as in the table at:
// http://docs.python.org/3.3/library/exceptions.html
MP_DEFINE_EXCEPTION_BASE(BaseException)
MP_DEFINE_EXCEPTION(SystemExit, BaseException)
//MP_DEFINE_EXCEPTION(SystemExit, BaseException)
//MP_DEFINE_EXCEPTION(KeyboardInterrupt, BaseException)
MP_DEFINE_EXCEPTION(GeneratorExit, BaseException)
MP_DEFINE_EXCEPTION(Exception, BaseException)
@@ -110,7 +110,7 @@ MP_DEFINE_EXCEPTION(Exception, BaseException)
MP_DEFINE_EXCEPTION(AssertionError, Exception)
MP_DEFINE_EXCEPTION(AttributeError, Exception)
MP_DEFINE_EXCEPTION(BufferError, Exception)
MP_DEFINE_EXCEPTION(EnvironmentError, Exception)
//MP_DEFINE_EXCEPTION(EnvironmentError, Exception)
MP_DEFINE_EXCEPTION(EOFError, Exception)
MP_DEFINE_EXCEPTION(ImportError, Exception)
MP_DEFINE_EXCEPTION(IOError, Exception)
@@ -140,7 +140,7 @@ MP_DEFINE_EXCEPTION(Exception, BaseException)
MP_DEFINE_EXCEPTION(TimeoutError, OSError)*/
MP_DEFINE_EXCEPTION(FileExistsError, OSError)
MP_DEFINE_EXCEPTION(FileNotFoundError, OSError)
MP_DEFINE_EXCEPTION(ReferenceError, Exception)
//MP_DEFINE_EXCEPTION(ReferenceError, Exception)
MP_DEFINE_EXCEPTION(RuntimeError, Exception)
MP_DEFINE_EXCEPTION_BASE(RuntimeError)
MP_DEFINE_EXCEPTION(NotImplementedError, RuntimeError)
@@ -148,7 +148,7 @@ MP_DEFINE_EXCEPTION(Exception, BaseException)
MP_DEFINE_EXCEPTION_BASE(SyntaxError)
MP_DEFINE_EXCEPTION(IndentationError, SyntaxError)
MP_DEFINE_EXCEPTION_BASE(IndentationError)
MP_DEFINE_EXCEPTION(TabError, IndentationError)
//MP_DEFINE_EXCEPTION(TabError, IndentationError)
MP_DEFINE_EXCEPTION(SystemError, Exception)
MP_DEFINE_EXCEPTION(TypeError, Exception)
MP_DEFINE_EXCEPTION(ValueError, Exception)