3 from __future__
import absolute_import
4 from __future__
import division
5 from __future__
import print_function
6 from __future__
import unicode_literals
13 hasattr(sys,
'getdlopenflags')
and hasattr(sys,
'setdlopenflags'))
16 @contextlib.contextmanager
17 def DlopenGuard(extra_flags=ctypes.RTLD_GLOBAL):
19 old_flags = sys.getdlopenflags()
20 sys.setdlopenflags(old_flags | extra_flags)
23 sys.setdlopenflags(old_flags)