summaryrefslogtreecommitdiff
path: root/tests/run/extern_impl_excvalue.srctree
blob: 190c81a6dbdf9e89b3c27a23649fa785cf2d1d88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
PYTHON setup.py build_ext --inplace
PYTHON -c "import foo"
PYTHON -c "import a"

######## setup.py ########

from Cython.Build import cythonize
from distutils.core import setup

setup(
  ext_modules = cythonize("*.pyx"),
)

######## foo.pxd ########

cdef int bar() except *

######## foo.pyx ########

cdef extern from "bar_impl.c":
    int bar() except *

######## bar_impl.c ########

static int bar() { return -1; }

######## a.pyx ########

cimport cython
from foo cimport bar

assert bar() == -1