Introduced some code to improve defensive programming in the BackgroundService class. maintenance

Sun, 09 Apr 2017 16:33:44 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 09 Apr 2017 16:33:44 +0200
branch
maintenance
changeset 5688
76fc12e08e8f
parent 5687
42ff6c5b186c
child 5694
27f8227ba598

Introduced some code to improve defensive programming in the BackgroundService class.

Utilities/BackgroundService.py file | annotate | diff | comparison | revisions
--- a/Utilities/BackgroundService.py	Sun Apr 09 16:17:11 2017 +0200
+++ b/Utilities/BackgroundService.py	Sun Apr 09 16:33:44 2017 +0200
@@ -214,7 +214,10 @@
                 if data != "__DONE__":
                     callback = self.services.get((fx, lang))
                     if callback:
-                        callback[2](fn, *data)
+                        if isinstance(data, (list, tuple)):
+                            callback[2](fn, *data)
+                        elif isinstance(data, str):
+                            callback[3](fx, lang, fn, data)
                     continue
                 else:
                     self.batchJobDone.emit(fx, lang)

eric ide

mercurial