Changeset 2705

Show
Ignore:
Timestamp:
06/06/17 17:01:25 (1 month ago)
Author:
jwoithe
Message:

dbus_util: import DBusQtMainLoop from dbus.mainloop.pyqt5 if dbus.mainloop.qt fails.

While "dbus.mainloop.qt" appears to have been present in earlier versions of
the PyQt?5 dbus modules for compatibility reasons, it seems it has been
removed in recent versions. Therefore if use of "dbus.mainloop.qt" fails,
try using "dbus.mainloop.pyqt5" instead.

This issue was noticed by Xavier Forestier and reported (with the suggested
fix) via the ffado-devel mailing list on 6 June 2017.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/support/mixer-qt4/ffado/dbus_util.py

    r2670 r2705  
    2525 
    2626import dbus 
    27 import dbus.mainloop.qt 
    28 dbus.mainloop.qt.DBusQtMainLoop(set_as_default=True) 
     27try: 
     28    # First try the PyQt4 module name 
     29    from dbus.mainloop.qt import DBusQtMainLoop 
     30except ImportError: 
     31    from dbus.mainloop.pyqt5 import DBusQtMainLoop 
     32 
     33DBusQtMainLoop(set_as_default=True) 
    2934 
    3035import logging