summaryrefslogtreecommitdiffstatshomepage
path: root/py/objexcept.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-07-01 14:28:09 +0100
committerDamien George <damien.p.george@gmail.com>2014-07-01 14:28:09 +0100
commitf0b29729aa086892a2dc6640a9fe619bb723e5fa (patch)
tree5261ef47c946e0db2b619829513945889e7e4ab6 /py/objexcept.c
parentf065344d3b5d88bc09e0028382f26ab60de2b5b2 (diff)
downloadmicropython-f0b29729aa086892a2dc6640a9fe619bb723e5fa.tar.gz
micropython-f0b29729aa086892a2dc6640a9fe619bb723e5fa.zip
py, objexcept: Only check for locked gc if gc is enabled.
Diffstat (limited to 'py/objexcept.c')
-rw-r--r--py/objexcept.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/py/objexcept.c b/py/objexcept.c
index b4a831c628..ad66bb50fe 100644
--- a/py/objexcept.c
+++ b/py/objexcept.c
@@ -336,10 +336,13 @@ void mp_obj_exception_clear_traceback(mp_obj_t self_in) {
}
void mp_obj_exception_add_traceback(mp_obj_t self_in, qstr file, machine_uint_t line, qstr block) {
+ #if MICROPY_ENABLE_GC
if (gc_is_locked()) {
// We can't allocate memory, so don't bother to try
return;
}
+ #endif
+
GET_NATIVE_EXCEPTION(self, self_in);
// for traceback, we are just using the list object for convenience, it's not really a list of Python objects