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
This commit is contained in:
Thomas Vander Stichele 2005-10-05 09:02:19 +00:00
parent 2c73056985
commit acdb03ae74
2 changed files with 13 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2005-10-05 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/__init__.py:
only pygtk.require if pygtk wasn't imported yet
2005-10-05 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/__init__.py:

View file

@ -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: