Python syntax error with D-BUS 0.34

John (J5) Palmieri johnp at redhat.com
Sun Jul 10 02:01:38 EST 2005


are you using python 2.4?  The decorator syntax is a Python 2.4 thing
But you are right I should split up the modules.  People will complain
but now is the time to do that stuff.

On Sat, 2005-07-09 at 15:10 +0100, Thomas Leonard wrote:
> Hi all,
> 
> While updating ROX-Session to support D-BUS 0.34, I hit a problem with the
> Python bindings:
> 
> $ python
> Python 2.3.5 (#2, Jun 19 2005, 13:28:00) 
> >>> import dbus
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "/usr/local/lib/python2.3/site-packages/dbus/__init__.py", line 1, in ?
>     from _dbus import *
>   File "/usr/local/lib/python2.3/site-packages/dbus/_dbus.py", line 48, in ?
>     from services import *
>   File "/usr/local/lib/python2.3/site-packages/dbus/services.py", line 179
>     @method('org.freedesktop.DBus.Introspectable')
>     ^
> SyntaxError: invalid syntax
> 
> 
> I was able to work around this with:
> 
> import empty
> sys.modules['dbus.services'] = empty
> 
> (where 'empty.py' is an empty file)
> 
> It all seems to work OK now. However, it would be nicer if this wasn't
> necessary. Perhaps 'services' could be made an optional import, so people
> who don't need it don't have to import it? Currently, there's a
> 
> from services import *
> 
> in dbus/__init__.py, which doesn't really seem necessary.
> 
> 
> -- 
> Dr Thomas Leonard		http://rox.sourceforge.net
> GPG: 9242 9807 C985 3C07 44A6  8B9A AE07 8280 59A5 3CC1
> 
> 
-- 
John (J5) Palmieri <johnp at redhat.com>



More information about the dbus mailing list