Commit 0f4c46f8 authored by Stefan Behnel's avatar Stefan Behnel

Merge branch '0.27.x'

parents 776b0553 1d37f2ae
......@@ -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
......
......@@ -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:
......
......@@ -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'
"""
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