You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library doesn't work if there are any generators in the stack as the compiled raise __traceback_maker actually executes without raising an error if flag 0x20 (CO_GENERATOR) is set.
In general, mucking around with code attributes isn't really safe, and in the worst case could potentially cause a segfault when the code is executed. The filename and name (the two that actually matter as they are used by the exception printing system) should be safe. I wouldn't touch nlocals, stacksize, or flags though. I have seen instances where the overridden nlocals causes the exec itself to throw because there are no locals which screws up the line numbers in the tracebacks.
The text was updated successfully, but these errors were encountered:
This library doesn't work if there are any generators in the stack as the compiled
raise __traceback_maker
actually executes without raising an error if flag 0x20 (CO_GENERATOR) is set.Simple repro:
In general, mucking around with code attributes isn't really safe, and in the worst case could potentially cause a segfault when the code is executed. The filename and name (the two that actually matter as they are used by the exception printing system) should be safe. I wouldn't touch nlocals, stacksize, or flags though. I have seen instances where the overridden nlocals causes the exec itself to throw because there are no locals which screws up the line numbers in the tracebacks.
The text was updated successfully, but these errors were encountered: