diff --git a/bin/sugar-activity b/bin/sugar-activity index 135584d5..ccca503a 100644 --- a/bin/sugar-activity +++ b/bin/sugar-activity @@ -145,12 +145,18 @@ def main(): if not name: SingleProcess(service_name, activity_constructor) else: - single_process = sessionbus.get_object(service_name, service_path) - single_process.create(activity_handle.get_dict(), - dbus_interface='org.laptop.SingleProcess') + try: + single_process = sessionbus.get_object(service_name, + service_path) + single_process.create( + activity_handle.get_dict(), + dbus_interface='org.laptop.SingleProcess') - print 'Created %s in a single process.' % service_name - sys.exit(0) + print 'Created %s in a single process.' % service_name + sys.exit(0) + except (TypeError, dbus.DBusException): + print 'Could not communicate with the instance process,' \ + 'launching a new process' if hasattr(module, 'start'): module.start()