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> 2008-11-07 Jan Schmidt <jan.schmidt@sun.com>
* gst/gst.override: * gst/gst.override:

View file

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