summaryrefslogtreecommitdiff
path: root/Cython/Compiler/ParseTreeTransforms.py
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2017-09-02 12:19:00 +0200
committerStefan Behnel <stefan_ml@behnel.de>2017-09-02 12:19:00 +0200
commit0b096e9362c766f4902eecbbea75fa410dfbb1ab (patch)
tree649a18b0f279b3c53fbae08377a3447b1d8f2a53 /Cython/Compiler/ParseTreeTransforms.py
parentc0b299e20a1b9849117c147f6d44b87990859872 (diff)
downloadcython-0b096e9362c766f4902eecbbea75fa410dfbb1ab.tar.gz
Avoid useless instance assignment on NameNode to save a bit of memory.
Diffstat (limited to 'Cython/Compiler/ParseTreeTransforms.py')
-rw-r--r--Cython/Compiler/ParseTreeTransforms.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py
index dc079e071..5aee68d0b 100644
--- a/Cython/Compiler/ParseTreeTransforms.py
+++ b/Cython/Compiler/ParseTreeTransforms.py
@@ -852,7 +852,9 @@ class InterpretCompilerDirectives(CythonTransform, SkipDeclarations):
if node.name in self.cython_module_names:
node.is_cython_module = True
else:
- node.cython_attribute = self.directive_names.get(node.name)
+ directive = self.directive_names.get(node.name)
+ if directive is not None:
+ node.cython_attribute = directive
return node
def try_to_parse_directives(self, node):