Comment 37 for bug 893091

Revision history for this message
In , Steven Johnson (sjohnson) wrote :

(In reply to comment #30)
> Actually using "as" doesn't work because it breaks older versions. Ideally we
> should be running from the same source on Python 3 and Python 2. I don't think
> we can assume everyone has moved to 2.6/2.7 which brings some of the Python 3
> constructs to Python 2

You are correct my change would not work pre 2.6. The problems are deeper than that though. I just fired it up under python 3.2a3 and I get :

>>> import dbus
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/Python-3.2a3/lib/python3.2/site-packages/dbus/__init__.py", line 79, in <module>
    import dbus.types as types
  File "/opt/Python-3.2a3/lib/python3.2/site-packages/dbus/types.py", line 6, in <module>
    from _dbus_bindings import ObjectPath, ByteArray, Signature, Byte,\
ImportError: /opt/Python-3.2a3/lib/python3.2/site-packages/_dbus_bindings.so: undefined symbol: PyCObject_FromVoidPtr

After some research I came to learn PyCObject is deprecated in 2.7 and removed in 3.2 in favour of PyCapsule (as its C code it can probably be fixed with #if's, but its getting messy). I am just trying to learn what the changes actually entail now.