rbrewer123 / pycsp

Automatically exported from code.google.com/p/pycsp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No exception propagation from within @pycsp.greenlets.io-decorated functions.

GoogleCodeExporter opened this issue · comments

Reproduce:

>>> import pycsp.greenlets as pycsp
>>> import time
>>> @pycsp.io
... def blocking():
...   time.sleep(1)
...   raise Exception('OMG!')
... 
>>> @pycsp.process
... def show():
...   try:
...     blocking()
...   except Exception as ex:
...     print 'Exception caught: %s' % str(ex)
...   else:
...     print 'No exception!'
... 
>>> pycsp.Parallel(show())

Expected output:

Exception caught: OMG!

Actual output:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/usr/local/lib/python2.6/dist-packages/pycsp/greenlets/scheduling.py", line 97, in run
    self.retval = self.fn(*self.args, **self.kwargs)
  File "<stdin>", line 4, in blocking
Exception: OMG!

Original issue reported on code.google.com by dirk...@gmail.com on 15 Jun 2010 at 11:09

Set Rune as owner -- I probably won't find the time before deadline on Aug 11.

Original comment by dirk...@gmail.com on 15 Jun 2010 at 12:29

  • Added labels: greenlets
[deleted comment]
Should be verified that the behaviour is wanted.

Original comment by runedren...@gmail.com on 25 Jun 2010 at 2:38

  • Changed state: Fixed
  • Removed labels: greenlets