Commit cb858c83 authored by Stefan Behnel's avatar Stefan Behnel

fix constant_result of SliceNode

parent 79f7d7f3
...@@ -2691,14 +2691,16 @@ class SliceNode(ExprNode): ...@@ -2691,14 +2691,16 @@ class SliceNode(ExprNode):
# stop ExprNode # stop ExprNode
# step ExprNode # step ExprNode
subexprs = ['start', 'stop', 'step']
type = py_object_type type = py_object_type
is_temp = 1 is_temp = 1
def calculate_constant_result(self): def calculate_constant_result(self):
self.constant_result = self.base.constant_result[ self.constant_result = slice(
self.start.constant_result : \ self.start.constant_result,
self.stop.constant_result : \ self.stop.constant_result,
self.step.constant_result] self.step.constant_result)
def compile_time_value(self, denv): def compile_time_value(self, denv):
start = self.start.compile_time_value(denv) start = self.start.compile_time_value(denv)
...@@ -2715,8 +2717,6 @@ class SliceNode(ExprNode): ...@@ -2715,8 +2717,6 @@ class SliceNode(ExprNode):
except Exception, e: except Exception, e:
self.compile_time_value_error(e) self.compile_time_value_error(e)
subexprs = ['start', 'stop', 'step']
def analyse_types(self, env): def analyse_types(self, env):
self.start.analyse_types(env) self.start.analyse_types(env)
self.stop.analyse_types(env) self.stop.analyse_types(env)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment