gst/__init__.py: Fix on systems that don't have dlopen or don't support RTLD_GLOBAL and

Original commit message from CVS:
reviewed by: Edward Hervey <edward.hervey@collabora.co.uk>
* gst/__init__.py:
Fix on systems that don't have dlopen or don't support RTLD_GLOBAL and
RTLD_LAZY.
This commit is contained in:
Alessandro Decina 2008-11-08 11:49:30 +00:00
parent d5c7296122
commit e9bf8a0868
2 changed files with 24 additions and 10 deletions

View file

@ -1,3 +1,11 @@
2008-11-08 Alessandro Decina <alessandro.d@gmail.com>
reviewed by: Edward Hervey <edward.hervey@collabora.co.uk>
* gst/__init__.py:
Fix on systems that don't have dlopen or don't support RTLD_GLOBAL and
RTLD_LAZY.
2008-11-07 Jan Schmidt <jan.schmidt@sun.com>
* gst/gst.override:

View file

@ -146,9 +146,13 @@ class Fraction(Value):
return float(self.num) / float(self.denom)
import sys
dlsave = sys.getdlopenflags()
try:
dlsave = sys.getdlopenflags()
from DLFCN import RTLD_GLOBAL, RTLD_LAZY
except AttributeError:
# windows doesn't have sys.getdlopenflags()
RTLD_GLOBAL = -1
RTLD_LAZY = -1
except ImportError:
RTLD_GLOBAL = -1
RTLD_LAZY = -1
@ -172,18 +176,20 @@ except:
if RTLD_GLOBAL != -1 and RTLD_LAZY != -1:
sys.setdlopenflags(RTLD_LAZY | RTLD_GLOBAL)
try:
import libxml2
except:
pass
from _gst import *
import interfaces
try:
import libxml2
except:
pass
from _gst import *
import interfaces
if RTLD_GLOBAL != -1 and RTLD_LAZY != -1:
sys.setdlopenflags(dlsave)
del sys
version = get_gst_version
sys.setdlopenflags(dlsave)
del sys
# Fixes for API cleanups that would cause an API breakage.
# See #446674