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
Kirill Smelkov
cython
Commits
0f4c46f8
Commit
0f4c46f8
authored
Oct 03, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.27.x'
parents
776b0553
1d37f2ae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
+15
-5
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+8
-3
runtests.py
runtests.py
+2
-2
tests/errors/cdef_class_properties_decorated.pyx
tests/errors/cdef_class_properties_decorated.pyx
+5
-0
No files found.
Cython/Compiler/ParseTreeTransforms.py
View file @
0f4c46f8
...
...
@@ -1385,10 +1385,15 @@ class DecoratorTransform(ScopeTrackingTransform, SkipDeclarations):
elif
decorator
.
is_attribute
and
decorator
.
obj
.
name
in
properties
:
handler_name
=
self
.
_map_property_attribute
(
decorator
.
attribute
)
if
handler_name
:
assert
decorator
.
obj
.
name
==
node
.
name
if
len
(
node
.
decorators
)
>
1
:
if
decorator
.
obj
.
name
!=
node
.
name
:
# CPython does not generate an error or warning, but not something useful either.
error
(
decorator_node
.
pos
,
"Mismatching property names, expected '%s', got '%s'"
%
(
decorator
.
obj
.
name
,
node
.
name
))
elif
len
(
node
.
decorators
)
>
1
:
return
self
.
_reject_decorated_property
(
node
,
decorator_node
)
return
self
.
_add_to_property
(
properties
,
node
,
handler_name
,
decorator_node
)
else
:
return
self
.
_add_to_property
(
properties
,
node
,
handler_name
,
decorator_node
)
# we clear node.decorators, so we need to set the
# is_staticmethod/is_classmethod attributes now
...
...
runtests.py
View file @
0f4c46f8
...
...
@@ -990,6 +990,8 @@ class CythonCompileTestCase(unittest.TestCase):
self.fail('Nondeterministic file generation: %s' % ', '.join(diffs))
tostderr = sys.__stderr__.write
if expected_warnings or (expect_warnings and warnings):
self._match_output(expected_warnings, warnings, tostderr)
if 'cerror' in self.tags['tag']:
if errors:
tostderr("
\
n
=== Expected C compile error ===
\
n
")
...
...
@@ -1000,8 +1002,6 @@ class CythonCompileTestCase(unittest.TestCase):
elif errors or expected_errors:
self._match_output(expected_errors, errors, tostderr)
return None
if expected_warnings or (expect_warnings and warnings):
self._match_output(expected_warnings, warnings, tostderr)
so_path = None
if not self.cython_only:
...
...
tests/errors/cdef_class_properties_decorated.pyx
View file @
0f4c46f8
...
...
@@ -34,9 +34,14 @@ cdef class Prop:
def
prop2
(
self
,
value
):
pass
@
prop2
.
setter
def
other_name
(
self
,
value
):
pass
_ERRORS
=
"""
19:4: Property methods with additional decorators are not supported
27:4: Property methods with additional decorators are not supported
33:4: Property methods with additional decorators are not supported
37:4: Mismatching property names, expected 'prop2', got 'other_name'
"""
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