diff --git a/iobber/chunker.py b/iobber/chunker.py index d8724990acc0d65b20f51fb9e15d62f23c5ba422..3b705f3aad8fd2b85e9aa7e86529f3a04aac4586 100644 --- a/iobber/chunker.py +++ b/iobber/chunker.py @@ -17,7 +17,8 @@ __doc__ = """The actual chunker implementation.""" # SWIG bug workaround: loading multiple SWIG modules brought unwrapped # swig::stop_iteration exceptions import ctypes, sys -sys.setdlopenflags(sys.getdlopenflags() | ctypes.RTLD_GLOBAL) +if 'setdlopenflags' in sys.__dict__: + sys.setdlopenflags(sys.getdlopenflags() | ctypes.RTLD_GLOBAL) import corpus2 # TODO: get back to default dlopen policy? diff --git a/iobber/corpio.py b/iobber/corpio.py index ddf27374681c152acb498c9650ebf496f204a985..5304651464b0baf14e050e4ff7f20454237d31cd 100644 --- a/iobber/corpio.py +++ b/iobber/corpio.py @@ -15,7 +15,8 @@ # SWIG bug workaround: loading multiple SWIG modules brought unwrapped # swig::stop_iteration exceptions import ctypes, sys -sys.setdlopenflags(sys.getdlopenflags() | ctypes.RTLD_GLOBAL) +if 'setdlopenflags' in sys.__dict__: + sys.setdlopenflags(sys.getdlopenflags() | ctypes.RTLD_GLOBAL) import corpus2, wccl # TODO: get back to default dlopen policy?