tbarnetlamb / hyphen

hyphen - access Haskell modules from Python
GNU General Public License v2.0
91 stars 9 forks source link

Better handling of exceptions #6

Closed tbarnetlamb closed 6 years ago

tbarnetlamb commented 6 years ago

Previously we assumed that every Python Exception would eventually be re-released into Python, which is not correct. To ensure correct behavior in the case where Haskell handles the exception, we must use ForeignPtrs

Also add more tests for various edge cases in exception propagation.

Finally, improve handling of asynchronous exceptions, ensuring that they are masked in most hyphen code and properly handled (previously they would cause a crash if they arrived in hyphen code, although they were correctly handled if they arrived in user Haskell code...)