pyclipper icon indicating copy to clipboard operation
pyclipper copied to clipboard

Exceptions aren't translated to Python

Open thatch opened this issue 7 years ago • 1 comments

For example, playing in the REPL I forgot to close a path:

>>> pco = pyclipper.PyclipperOffset()
>>> pc.AddPath([[0,0], [10,0], [10,10], [0, 10]], pyclipper.JT_ROUND, pyclipper.ET_CLOSEDPOLYGON)
terminate called after throwing an instance of 'ClipperLib::clipperException'
  what():  AddPath: Open paths must be subject.
Aborted (core dumped)

thatch avatar Jun 18 '18 23:06 thatch

it's possible to declare such functions that may throw a c++ exception with an except +

http://cython.readthedocs.io/en/latest/src/userguide/wrapping_CPlusPlus.html#exceptions

would you like to work on a PR?

anthrotype avatar Jun 19 '18 09:06 anthrotype