diff --git a/sugar/activity/activityfactory.py b/sugar/activity/activityfactory.py index 10417479..41439780 100644 --- a/sugar/activity/activityfactory.py +++ b/sugar/activity/activityfactory.py @@ -29,6 +29,13 @@ from sugar import util import os +# #3903 - this constant can be removed and assumed to be 1 when dbus-python +# 0.82.3 is the only version used +if dbus.version >= (0, 82, 3): + DBUS_PYTHON_TIMEOUT_UNITS_PER_SECOND = 1 +else: + DBUS_PYTHON_TIMEOUT_UNITS_PER_SECOND = 1000 + _SHELL_SERVICE = "org.laptop.Shell" _SHELL_PATH = "/org/laptop/Shell" _SHELL_IFACE = "org.laptop.Shell" @@ -143,7 +150,7 @@ class ActivityCreationHandler(gobject.GObject): if not os.path.exists('/etc/olpc-security'): handle = self._handle.get_dict() self._factory.create(dbus.Dictionary(handle, signature='ss'), - timeout=120 * 1000, + timeout=120 * DBUS_PYTHON_TIMEOUT_UNITS_PER_SECOND, reply_handler=self._no_reply_handler, error_handler=self._create_error_handler) else: @@ -153,7 +160,7 @@ class ActivityCreationHandler(gobject.GObject): factory.CreateActivity( self._service_name, self._handle.get_dict(), - timeout=120 * 1000, + timeout=120 * DBUS_PYTHON_TIMEOUT_UNITS_PER_SECOND, reply_handler=self._create_reply_handler, error_handler=self._create_error_handler, dbus_interface=_RAINBOW_ACTIVITY_FACTORY_INTERFACE)