Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
9e7fdef1
Commit
9e7fdef1
authored
Sep 25, 2018
by
mattip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MAINT: fixes from review
parent
920aee84
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+2
-2
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+8
-0
tests/run/check_size.srctree
tests/run/check_size.srctree
+4
-3
No files found.
Cython/Compiler/ModuleNode.py
View file @
9e7fdef1
...
...
@@ -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 "
...
...
Cython/Compiler/Parsing.py
View file @
9e7fdef1
...
...
@@ -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
()
...
...
tests/run/check_size.srctree
View file @
9e7fdef1
...
...
@@ -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
Attribut
eError as e:
assert 'max' in str(e)
except
Compil
eError 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
AttributeE
rror when using bad value
# Raise
Compile
rror when using bad value
ctypedef class check_size.Foo [object FooStructSmall, check_size max]:
cdef:
int f9
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment