mylibrary_module = Extension('_mylibrary', extra_compile_args=['/EHsc'],
    sources=['mylibrary_wrap.cpp', 'mylibrary.cpp'])
setup(name='mylibrary', version='1.0', description=
    'Testing user defined exceptions...', ext_modules=[mylibrary_module],
    py_modules=['mylibrary'])
How do I propagate C++ exceptions to Python in a SWIG wrapper library?