projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb09b85
)
always optimise tuple(some_list), not only for literals
author
Stefan Behnel
<scoder@users.berlios.de>
Tue, 15 Sep 2009 12:12:40 +0000
(14:12 +0200)
committer
Stefan Behnel
<scoder@users.berlios.de>
Tue, 15 Sep 2009 12:12:40 +0000
(14:12 +0200)
Cython/Compiler/Optimize.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/Optimize.py
b/Cython/Compiler/Optimize.py
index 261f6c148b9f68facf4293f6f277984b540eb8db..425c7f6eff136fa95fe1bc7fe3bfdfdb0894dd9f 100644
(file)
--- a/
Cython/Compiler/Optimize.py
+++ b/
Cython/Compiler/Optimize.py
@@
-667,8
+667,9
@@
class OptimizeBuiltinCalls(Visitor.VisitorTransform):
return node
if not isinstance(list_arg, (ExprNodes.ComprehensionNode,
ExprNodes.ListNode)):
- # everything else may be None => take the safe path
- return node
+ pos_args.args[0] = ExprNodes.NoneCheckNode(
+ list_arg, "PyExc_TypeError",
+ "'NoneType' object is not iterable")
return ExprNodes.PythonCapiCallNode(
node.pos, "PyList_AsTuple", self.PyList_AsTuple_func_type,