summaryrefslogtreecommitdiff
path: root/tests/errors/cimport_attributes.pyx
blob: 7037b9aa3d6c2382c5685251788a227ef7e3fc59 (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
# mode: error
# tag: cpp


cimport libcpp
print libcpp.no_such_attribute

cimport libcpp.map
print libcpp.map.no_such_attribute

from libcpp cimport vector
print vector.no_such_attribute

from libcpp cimport vector as my_vector
print my_vector.no_such_attribute

from libcpp cimport vector as my_vector_with_shadow
from libcpp import vector as my_vector_with_shadow
print my_vector_with_shadow.python_attribute   # OK (if such a module existed at runtime)

# Other ordering
from libcpp import map as my_map_with_shadow
from libcpp cimport map as my_map_with_shadow
print my_map_with_shadow.python_attribute   # OK (if such a module existed at runtime)


_ERRORS = u"""
6:12: cimported module has no attribute 'no_such_attribute'
9:16: cimported module has no attribute 'no_such_attribute'
12:12: cimported module has no attribute 'no_such_attribute'
15:15: cimported module has no attribute 'no_such_attribute'
"""