On Aug 21, 2012, at 06:05 AM, Steve Langasek wrote:
>if 'gi.repository' in sys.modules: > from gi.repository import GObject >else: > try: > import gobject as GObject > except: > from gi.repository import GObject
dbus-python does something like this, with minor differences:
if 'gi' in sys.modules: from gi.repository import GObject as gobject else: import gobject
See dbus.gobject_service.py for details.
On Aug 21, 2012, at 06:05 AM, Steve Langasek wrote:
>if 'gi.repository' in sys.modules:
> from gi.repository import GObject
>else:
> try:
> import gobject as GObject
> except:
> from gi.repository import GObject
dbus-python does something like this, with minor differences:
if 'gi' in sys.modules:
from gi.repository import GObject as gobject
else:
import gobject
See dbus.gobject_ service. py for details.