Proxied old-style classes can't be instantiated

Bug #738216 reported by Andrew Wilkins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pushy
Fix Released
Medium
Andrew Wilkins

Bug Description

>>> conn = pushy.connect("local:")
>>> conn.execute("""\
... class X:
... def __init__(self):
... print 123
""", locals=locals_)
>>> locals_["X"]()

Traceback (most recent call last):
  File "test_local.py", line 14, in <module>
    locals_["X"]()
TypeError: 'ObjectProxy' object is not callable

Related branches

Revision history for this message
Andrew Wilkins (axwalk) wrote :

The problem is that old-style class objects don't have a __call__ method, whereas new-style classes do. I have added a new proxy type (oldstyleclass) which adds a __call__ method that calls the remote constructor.

Changed in pushy:
status: Confirmed → Fix Committed
Andrew Wilkins (axwalk)
Changed in pushy:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.