From acdb03ae74820468d168ea76b39c5b4d2636c48f Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Wed, 5 Oct 2005 09:02:19 +0000 Subject: [PATCH] gst/__init__.py: only pygtk.require if pygtk wasn't imported yet Original commit message from CVS: * gst/__init__.py: only pygtk.require if pygtk wasn't imported yet --- ChangeLog | 5 +++++ gst/__init__.py | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 768144ae61..309c7752e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-10-05 Thomas Vander Stichele + + * gst/__init__.py: + only pygtk.require if pygtk wasn't imported yet + 2005-10-05 Thomas Vander Stichele * gst/__init__.py: diff --git a/gst/__init__.py b/gst/__init__.py index 5087a7b747..85e09de733 100644 --- a/gst/__init__.py +++ b/gst/__init__.py @@ -28,11 +28,16 @@ try: except: pass -import pygtk -pygtk.require('2.0') +import sys + +# we always require 2.0 of pygtk; so if pygtk is not imported anywhere +# yet, we import pygtk here and .require +if not sys.modules.has_key('pygtk'): + import pygtk + pygtk.require('2.0') try: - import sys, DLFCN + import DLFCN sys.setdlopenflags(DLFCN.RTLD_LAZY | DLFCN.RTLD_GLOBAL) del sys, DLFCN except ImportError: