From cb858c83300f4296024eb49d49124fc6f724878e Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Mon, 31 Jan 2011 12:41:58 +0100 Subject: [PATCH] fix constant_result of SliceNode --- Cython/Compiler/ExprNodes.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 555588cf..fc059eb9 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -2691,14 +2691,16 @@ class SliceNode(ExprNode): # stop ExprNode # step ExprNode + subexprs = ['start', 'stop', 'step'] + type = py_object_type is_temp = 1 def calculate_constant_result(self): - self.constant_result = self.base.constant_result[ - self.start.constant_result : \ - self.stop.constant_result : \ - self.step.constant_result] + self.constant_result = slice( + self.start.constant_result, + self.stop.constant_result, + self.step.constant_result) def compile_time_value(self, denv): start = self.start.compile_time_value(denv) @@ -2715,8 +2717,6 @@ class SliceNode(ExprNode): except Exception, e: self.compile_time_value_error(e) - subexprs = ['start', 'stop', 'step'] - def analyse_types(self, env): self.start.analyse_types(env) self.stop.analyse_types(env) -- 2.26.2