File gtg-fix-pynotify-crash.patch of Package gtg

Fix for lp#1264846 --
A function was registered with atexit which executed pynotify.uninit()
without checking whether the user had pynotify installed or not.
Since pynotify.init() was called everytime a notification had to
be sent, I've added uninit() in the same function.

Index: b/GTG/plugins/bugzilla/notification.py
===================================================================
--- a/GTG/plugins/bugzilla/notification.py
+++ b/GTG/plugins/bugzilla/notification.py
@@ -4,7 +4,6 @@
 Notification is used to show messages to GTG users.
 '''
 
-import atexit
 import subprocess
 
 __all__ = ("send_notification", )
@@ -24,6 +23,7 @@ def _notify_via_pynotify(title, message)
         # Keep quiet here when notification service is not avialable currently
         # sometime. For example, if user is using LXDE, no notifyd by default.
         pass
+    pynotify.uninit()
 
 
 def _notify_via_notify_send(title, message):
@@ -57,8 +57,3 @@ def send_notification(title, message):
 
     if _notify_handler is not None:
         _notify_handler(title, message)
-
-
-@atexit.register
-def uinit_pynotify():
-    pynotify.uninit()
openSUSE Build Service is sponsored by