Commit 1bcdc48d authored by Xavier Thompson's avatar Xavier Thompson

Fix PyObject -> CyObject conversions in method wrappers

parent 9916752e
...@@ -40,22 +40,22 @@ class CypclassWrapperInjection(Visitor.CythonTransform): ...@@ -40,22 +40,22 @@ class CypclassWrapperInjection(Visitor.CythonTransform):
unlocked_property = TreeFragment.TreeFragment(u""" unlocked_property = TreeFragment.TreeFragment(u"""
property NAME: property NAME:
def __get__(self): def __get__(self):
OBJ = <TYPE> <CyObject> self OBJ = <TYPE> self
return OBJ.ATTR return OBJ.ATTR
def __set__(self, value): def __set__(self, value):
OBJ = <TYPE> <CyObject> self OBJ = <TYPE> self
OBJ.ATTR = value OBJ.ATTR = value
""", level='c_class', pipeline=[NormalizeTree(None)]) """, level='c_class', pipeline=[NormalizeTree(None)])
locked_property = TreeFragment.TreeFragment(u""" locked_property = TreeFragment.TreeFragment(u"""
property NAME: property NAME:
def __get__(self): def __get__(self):
OBJ = <TYPE> <CyObject> self OBJ = <TYPE> self
with rlocked OBJ: with rlocked OBJ:
value = OBJ.ATTR value = OBJ.ATTR
return value return value
def __set__(self, value): def __set__(self, value):
OBJ = <TYPE> <CyObject> self OBJ = <TYPE> self
with wlocked OBJ: with wlocked OBJ:
OBJ.ATTR = value OBJ.ATTR = value
""", level='c_class', pipeline=[NormalizeTree(None)]) """, level='c_class', pipeline=[NormalizeTree(None)])
...@@ -63,40 +63,40 @@ property NAME: ...@@ -63,40 +63,40 @@ property NAME:
# method wrapper templates # method wrapper templates
unlocked_method = TreeFragment.TreeFragment(u""" unlocked_method = TreeFragment.TreeFragment(u"""
def NAME(self, ARGDECLS): def NAME(self, ARGDECLS):
OBJ = <TYPE> <CyObject> self OBJ = <TYPE> self
return OBJ.NAME(ARGS) return OBJ.NAME(ARGS)
""", level='c_class', pipeline=[NormalizeTree(None)]) """, level='c_class', pipeline=[NormalizeTree(None)])
unlocked_method_no_return = TreeFragment.TreeFragment(u""" unlocked_method_no_return = TreeFragment.TreeFragment(u"""
def NAME(self, ARGDECLS): def NAME(self, ARGDECLS):
OBJ = <TYPE> <CyObject> self OBJ = <TYPE> self
OBJ.NAME(ARGS) OBJ.NAME(ARGS)
""", level='c_class', pipeline=[NormalizeTree(None)]) """, level='c_class', pipeline=[NormalizeTree(None)])
rlocked_method = TreeFragment.TreeFragment(u""" rlocked_method = TreeFragment.TreeFragment(u"""
def NAME(self, ARGDECLS): def NAME(self, ARGDECLS):
OBJ = <TYPE> <CyObject> self OBJ = <TYPE> self
with rlocked OBJ: with rlocked OBJ:
return OBJ.NAME(ARGS) return OBJ.NAME(ARGS)
""", level='c_class', pipeline=[NormalizeTree(None)]) """, level='c_class', pipeline=[NormalizeTree(None)])
rlocked_method_no_return = TreeFragment.TreeFragment(u""" rlocked_method_no_return = TreeFragment.TreeFragment(u"""
def NAME(self, ARGDECLS): def NAME(self, ARGDECLS):
OBJ = <TYPE> <CyObject> self OBJ = <TYPE> self
with rlocked OBJ: with rlocked OBJ:
OBJ.NAME(ARGS) OBJ.NAME(ARGS)
""", level='c_class', pipeline=[NormalizeTree(None)]) """, level='c_class', pipeline=[NormalizeTree(None)])
wlocked_method = TreeFragment.TreeFragment(u""" wlocked_method = TreeFragment.TreeFragment(u"""
def NAME(self, ARGDECLS): def NAME(self, ARGDECLS):
OBJ = <TYPE> <CyObject> self OBJ = <TYPE> self
with wlocked OBJ: with wlocked OBJ:
return OBJ.NAME(ARGS) return OBJ.NAME(ARGS)
""", level='c_class', pipeline=[NormalizeTree(None)]) """, level='c_class', pipeline=[NormalizeTree(None)])
wlocked_method_no_return = TreeFragment.TreeFragment(u""" wlocked_method_no_return = TreeFragment.TreeFragment(u"""
def NAME(self, ARGDECLS): def NAME(self, ARGDECLS):
OBJ = <TYPE> <CyObject> self OBJ = <TYPE> self
with wlocked OBJ: with wlocked OBJ:
OBJ.NAME(ARGS) OBJ.NAME(ARGS)
""", level='c_class', pipeline=[NormalizeTree(None)]) """, level='c_class', pipeline=[NormalizeTree(None)])
......
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