Commit 00c8fa4b authored by Stefan Behnel's avatar Stefan Behnel Committed by Vitja Makarov

minor convenience change in temp code

parent ebffb4ef
...@@ -14,9 +14,12 @@ class TempHandle(object): ...@@ -14,9 +14,12 @@ class TempHandle(object):
# THIS IS DEPRECATED, USE LetRefNode instead # THIS IS DEPRECATED, USE LetRefNode instead
temp = None temp = None
needs_xdecref = False needs_xdecref = False
def __init__(self, type): def __init__(self, type, needs_cleanup=None):
self.type = type self.type = type
if needs_cleanup is None:
self.needs_cleanup = type.is_pyobject self.needs_cleanup = type.is_pyobject
else:
self.needs_cleanup = needs_cleanup
def ref(self, pos): def ref(self, pos):
return TempRefNode(pos, handle=self, type=self.type) return TempRefNode(pos, handle=self, type=self.type)
......
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