diff options
author | Damien George <damien.p.george@gmail.com> | 2014-02-15 21:05:25 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-02-15 21:05:25 +0000 |
commit | 22a0865d54579253c97a0d5916cc7b93bf8a049c (patch) | |
tree | ee4adb0bcc4b1ba3ae2f6072778d0a41528de0c2 /py/runtime.c | |
parent | 8725f8f7debb9b798783f5aae291d00a3950d8fc (diff) | |
download | micropython-22a0865d54579253c97a0d5916cc7b93bf8a049c.tar.gz micropython-22a0865d54579253c97a0d5916cc7b93bf8a049c.zip |
py: Improve exception bases, reduces ROM usage.
Thanks to @pfalcon for the tip!
Diffstat (limited to 'py/runtime.c')
-rw-r--r-- | py/runtime.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/py/runtime.c b/py/runtime.c index aa7940fd8e..798f7b671c 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -1003,6 +1003,8 @@ mp_obj_t rt_make_raise_obj(mp_obj_t o) { if (mp_obj_is_exception_type(o)) { // o is an exception type (it is derived from BaseException (or is BaseException)) // create and return a new exception instance by calling o + // TODO could have an option to disable traceback, then builtin exceptions (eg TypeError) + // could have const instances in ROM which we return here instead return rt_call_function_n_kw(o, 0, 0, NULL); } else if (mp_obj_is_exception_instance(o)) { // o is an instance of an exception, so use it as the exception |