Closed aaaaalbert closed 7 years ago
This traces back to wrapping createvirtualnamespace
and using the wrapped definition in namespace.py
(as opposed to repy.py
's override. With the wrapped call, the logic at the bottom of namespace.py
is triggered when VirtualNamespace.evaluate
, the wrapped namespace object method, is called. What happens is that Repy exceptions (like SocketWouldBlockError
, subclassing RepyException
) that are raised inside the virtual namespace match this clause, whereas pure Python errors like NameError
land down here and are considered fatal.
The fix I'll propose shortly will add a check and reraise if the blanket except
catches for a wrapped VirtualNamespace
call. I also have a unit test to go with this.
In a plain RepyV2 program, all is good:
raises the expected
Exception (with type 'exceptions.NameError'): name 'x' is not defined
, including a proper user-level traceback.Sure enough we can do this:
Inside a virtual namespace, things break:
Full traceback:
131 (different
Exception
types inside and outside the sandbox) could be related.