diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-11-14 02:23:30 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-11-14 02:29:09 +0300 |
commit | c3d96d387c461c25ca3298dfa73d2a4efb45f1e7 (patch) | |
tree | 1fa555956aee8a774ab4b6c3211f62d82faea11b /py/modgc.c | |
parent | bf318801d2fafa2786e74693d19a3c2fdb50ddda (diff) | |
download | micropython-c3d96d387c461c25ca3298dfa73d2a4efb45f1e7.tar.gz micropython-c3d96d387c461c25ca3298dfa73d2a4efb45f1e7.zip |
py/objexcept: Allow clearing traceback with 'exc.__traceback__ = None'.
We allow 'exc.__traceback__ = None' assignment as a low-level optimization
of pre-allocating exception instance and raising it repeatedly - this
avoids memory allocation during raise. However, uPy will keep adding
traceback entries to such exception instance, so before throwing it,
traceback should be cleared like above.
'exc.__traceback__ = None' syntax is CPython compatible. However, unlike
it, reading that attribute or setting it to any other value is not
supported (and not intended to be supported, again, the only reason for
adding this feature is to allow zero-memalloc exception raising).
Diffstat (limited to 'py/modgc.c')
0 files changed, 0 insertions, 0 deletions