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
Xavier Thompson
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):
...
@@ -3067,9 +3067,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
cs
=
0
cs
=
0
elif
type
.
check_size
==
'min'
:
elif
type
.
check_size
==
'min'
:
cs
=
1
cs
=
1
elif
type
.
check_size
==
'True'
:
elif
type
.
check_size
==
True
:
cs
=
0
cs
=
0
elif
type
.
check_size
==
'False'
:
elif
type
.
check_size
==
False
:
cs
=
2
cs
=
2
else
:
else
:
raise
AttributeError
(
"invalid value for check_size '%s' when compiling "
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):
...
@@ -3544,6 +3544,14 @@ def p_c_class_options(s):
elif
s
.
systring
==
'check_size'
:
elif
s
.
systring
==
'check_size'
:
s
.
next
()
s
.
next
()
check_size
=
p_ident
(
s
)
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
!=
','
:
if
s
.
sy
!=
','
:
break
break
s
.
next
()
s
.
next
()
...
...
tests/run/check_size.srctree
View file @
9e7fdef1
...
@@ -4,6 +4,7 @@ PYTHON -c "import runner"
...
@@ -4,6 +4,7 @@ PYTHON -c "import runner"
######## setup.py ########
######## setup.py ########
from Cython.Build.Dependencies import cythonize
from Cython.Build.Dependencies import cythonize
from Cython.Compiler.Errors import CompileError
from distutils.core import setup
from distutils.core import setup
# force the build order
# force the build order
...
@@ -14,8 +15,8 @@ setup(ext_modules = cythonize("_check_size*.pyx"))
...
@@ -14,8 +15,8 @@ setup(ext_modules = cythonize("_check_size*.pyx"))
try:
try:
setup(ext_modules= cythonize("check_size6.pyx"))
setup(ext_modules= cythonize("check_size6.pyx"))
assert False
assert False
except
Attribut
eError as e:
except
Compil
eError as e:
assert 'max' in str(e)
pass
######## check_size_nominal.h ########
######## check_size_nominal.h ########
...
@@ -168,7 +169,7 @@ cpdef public int testme(Foo f) except -1:
...
@@ -168,7 +169,7 @@ cpdef public int testme(Foo f) except -1:
cdef extern from "check_size_smaller.h":
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]:
ctypedef class check_size.Foo [object FooStructSmall, check_size max]:
cdef:
cdef:
int f9
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