summaryrefslogtreecommitdiff
path: root/Cython/Compiler/ParseTreeTransforms.py
diff options
context:
space:
mode:
authorscoder <stefan_ml@behnel.de>2017-06-25 23:48:30 +0200
committerGitHub <noreply@github.com>2017-06-25 23:48:30 +0200
commit8d727b674868d9fa441ef15ecde44ecbf273f809 (patch)
tree6e91b02ed53ee077a89816bb3cc63f53f9d7c14e /Cython/Compiler/ParseTreeTransforms.py
parent8705f0fa37f677cce90997d0aa271a441e11bdc0 (diff)
parent4f857124d93b3d1ea9a4627bd831526cda35870a (diff)
downloadcython-8d727b674868d9fa441ef15ecde44ecbf273f809.tar.gz
Merge branch 'master' into feature/pythran
Diffstat (limited to 'Cython/Compiler/ParseTreeTransforms.py')
-rw-r--r--Cython/Compiler/ParseTreeTransforms.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py
index 7e8c24843..4de78926c 100644
--- a/Cython/Compiler/ParseTreeTransforms.py
+++ b/Cython/Compiler/ParseTreeTransforms.py
@@ -1355,8 +1355,18 @@ class DecoratorTransform(ScopeTrackingTransform, SkipDeclarations):
return self._reject_decorated_property(node, decorator_node)
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
+ for decorator in node.decorators:
+ func = decorator.decorator
+ if func.is_name:
+ node.is_classmethod |= func.name == 'classmethod'
+ node.is_staticmethod |= func.name == 'staticmethod'
+
# transform normal decorators
- return self.chain_decorators(node, node.decorators, node.name)
+ decs = node.decorators
+ node.decorators = None
+ return self.chain_decorators(node, decs, node.name)
@staticmethod
def _reject_decorated_property(node, decorator_node):