Blame SOURCES/pykde4-4.10.5-crash_module.patch

4ea7b6
diff -up pykde4-4.10.5/__init__.py.me pykde4-4.10.5/__init__.py
4ea7b6
--- pykde4-4.10.5/__init__.py.me	2018-12-04 13:31:43.545667006 +0100
4ea7b6
+++ pykde4-4.10.5/__init__.py	2018-12-04 13:31:51.116708365 +0100
4ea7b6
@@ -1,4 +1,13 @@
4ea7b6
 import sys,DLFCN
4ea7b6
-# This is needed to ensure that dynamic_cast and RTTI works inside kdelibs.
4ea7b6
-sys.setdlopenflags(DLFCN.RTLD_NOW|DLFCN.RTLD_GLOBAL)
4ea7b6
-     
4ea7b6
\ Kein Zeilenumbruch am Dateiende.
4ea7b6
+
4ea7b6
+def main():
4ea7b6
+    dlopenflag = sys.getdlopenflags()
4ea7b6
+    try:
4ea7b6
+        # This is needed to ensure that dynamic_cast and RTTI works inside kdelibs.
4ea7b6
+        sys.setdlopenflags(DLFCN.RTLD_NOW|DLFCN.RTLD_GLOBAL)
4ea7b6
+    finally:
4ea7b6
+        # set to default dlopenflag to avoid problem in other modules
4ea7b6
+        sys.setdlopenflags(dlopenflag)
4ea7b6
+
4ea7b6
+if __name__=='__main__':
4ea7b6
+    main()