diff options
Diffstat (limited to 'tests/run/legacy_implicit_noexcept_build.srctree')
-rw-r--r-- | tests/run/legacy_implicit_noexcept_build.srctree | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/run/legacy_implicit_noexcept_build.srctree b/tests/run/legacy_implicit_noexcept_build.srctree new file mode 100644 index 000000000..c7b30693d --- /dev/null +++ b/tests/run/legacy_implicit_noexcept_build.srctree @@ -0,0 +1,33 @@ +PYTHON setup.py build_ext --inplace +PYTHON -c "import bar" + +######## setup.py ######## + +from Cython.Build.Dependencies import cythonize +from distutils.core import setup + +setup( + ext_modules = cythonize("*.pyx", compiler_directives={'legacy_implicit_noexcept': True}), +) + + +######## bar.pyx ######## + +cdef int func_noexcept() noexcept: + raise RuntimeError() + +cdef int func_implicit(): + raise RuntimeError() + +cdef int func_return_value() except -1: + raise RuntimeError() + +func_noexcept() +func_implicit() + +try: + func_return_value() +except RuntimeError: + pass +else: + assert False, 'Exception not raised' |