1. Team SimPy
  2. simpy
  3. simpy
  4. Issues
Issue #25 wontfix

Trim tracebacks in Process._resume()

luensdorf
created an issue

This is output of the example in issue #24:

Traceback (most recent call last):
  File "/home/thecom/src/simpy/simpy/core.py", line 434, in _resume
    next_evt = self._generator.send(value)
  File "/tmp/test.py", line 5, in a
    raise RuntimeError('fail')
RuntimeError: fail

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/thecom/src/simpy/simpy/core.py", line 439, in _resume
    next_evt = self._generator.throw(value)
  File "/tmp/test.py", line 8, in b
    yield env.start(a(env))
RuntimeError: fail

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/thecom/src/simpy/simpy/core.py", line 439, in _resume
    next_evt = self._generator.throw(value)
  File "/tmp/test.py", line 11, in c
    yield env.start(b(env))
RuntimeError: fail

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/tmp/test.py", line 15, in <module>
    simpy.simulate(env)
  File "/home/thecom/src/simpy/simpy/core.py", line 640, in simulate
    step(env)
  File "/home/thecom/src/simpy/simpy/core.py", line 604, in step
    raise value
RuntimeError: fail

The frames of _resume add no useful information and can be dropped. We should examine if removing the frame results in side-effects or heavy performance impacts.

Comments (6)

  1. luensdorf reporter

    As discussed with Stefan, this won't get implemented. Although this information is redundant it describes what really is happening. Omitting parts of it could lead to very hard to debug problems.

  2. Log in to comment