Commit 855fa445 authored by Mark Florisson's avatar Mark Florisson

Fix copying slice objects in python 2.4

parent 7272a40d
...@@ -13,6 +13,7 @@ cython.declare(error=object, warning=object, warn_once=object, InternalError=obj ...@@ -13,6 +13,7 @@ cython.declare(error=object, warning=object, warn_once=object, InternalError=obj
debug_disposal_code=object, debug_temp_alloc=object, debug_coercion=object) debug_disposal_code=object, debug_temp_alloc=object, debug_coercion=object)
import sys import sys
import copy
import operator import operator
from Errors import error, warning, warn_once, InternalError, CompileError from Errors import error, warning, warn_once, InternalError, CompileError
...@@ -3452,6 +3453,19 @@ class SliceNode(ExprNode): ...@@ -3452,6 +3453,19 @@ class SliceNode(ExprNode):
if self.is_literal: if self.is_literal:
code.put_giveref(self.py_result()) code.put_giveref(self.py_result())
def __deepcopy__(self, memo):
"""
There is a copy bug in python 2.4 for slice objects.
"""
return SliceNode(
self.pos,
start=copy.deepcopy(self.start, memo),
stop=copy.deepcopy(self.stop, memo),
step=copy.deepcopy(self.step, memo),
is_temp=self.is_temp,
is_literal=self.is_literal,
constant_result=self.constant_result)
class CallNode(ExprNode): class CallNode(ExprNode):
......
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