Commit 9e7fdef1 authored by mattip's avatar mattip

MAINT: fixes from review

parent 920aee84
......@@ -3067,9 +3067,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
cs = 0
elif type.check_size == 'min':
cs = 1
elif type.check_size == 'True':
elif type.check_size == True:
cs = 0
elif type.check_size == 'False':
elif type.check_size == False:
cs = 2
else:
raise AttributeError("invalid value for check_size '%s' when compiling "
......
......@@ -3544,6 +3544,14 @@ def p_c_class_options(s):
elif s.systring == 'check_size':
s.next()
check_size = p_ident(s)
if check_size == 'False':
check_size = False
elif check_size == 'True':
check_size = True
elif check_size == 'min':
pass
else:
s.error('Expected False, True, or min, not %r' % check_size)
if s.sy != ',':
break
s.next()
......
......@@ -4,6 +4,7 @@ PYTHON -c "import runner"
######## setup.py ########
from Cython.Build.Dependencies import cythonize
from Cython.Compiler.Errors import CompileError
from distutils.core import setup
# force the build order
......@@ -14,8 +15,8 @@ setup(ext_modules = cythonize("_check_size*.pyx"))
try:
setup(ext_modules= cythonize("check_size6.pyx"))
assert False
except AttributeError as e:
assert 'max' in str(e)
except CompileError as e:
pass
######## check_size_nominal.h ########
......@@ -168,7 +169,7 @@ cpdef public int testme(Foo f) except -1:
cdef extern from "check_size_smaller.h":
# Raise AttributeError when using bad value
# Raise Compilerror when using bad value
ctypedef class check_size.Foo [object FooStructSmall, check_size max]:
cdef:
int f9
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment