summaryrefslogtreecommitdiff
path: root/Cython/Compiler/ModuleNode.py
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2018-09-22 15:40:12 +0200
committerStefan Behnel <stefan_ml@behnel.de>2018-09-22 15:42:21 +0200
commit2a8dd0c02feaf7a75513017c1c1040b7ce6542ff (patch)
tree54e51f9ac93b75e67c2e1ae4a901502a34feb44f /Cython/Compiler/ModuleNode.py
parent1644e44c921123d712d49cfceba9e360acd6bb64 (diff)
downloadcython-2a8dd0c02feaf7a75513017c1c1040b7ce6542ff.tar.gz
Exclude 'const' globals from star-importing since they can't get assigned anyway.
Closes #2621.
Diffstat (limited to 'Cython/Compiler/ModuleNode.py')
-rw-r--r--Cython/Compiler/ModuleNode.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
index 84077f0ec..f170803fd 100644
--- a/Cython/Compiler/ModuleNode.py
+++ b/Cython/Compiler/ModuleNode.py
@@ -2238,7 +2238,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln("if (0);") # so the first one can be "else if"
msvc_count = 0
for name, entry in sorted(env.entries.items()):
- if entry.is_cglobal and entry.used:
+ if entry.is_cglobal and entry.used and not entry.type.is_const:
msvc_count += 1
if msvc_count % 100 == 0:
code.putln("#ifdef _MSC_VER")