Thomas Moreau added the comment:

I think this is a good solution as it let the user define easily the behavior 
it needs in other situation too. I would recommend adding the object 
responsible for the failure to the _on_queue_thread_error callback. This would 
simplify the error handling.


@@ -260,8 +260,16 @@ class Queue(object):
                     info('error in queue thread: %s', e)
                     return
                 else:
-                    import traceback
-                    traceback.print_exc()
+                    self._on_queue_thread_error(e, obj)
+
+    def _on_queue_thread_error(self, e, obj):
+        """
+        Private API called when feeding data in the background thread
+        raises an exception.  For overriding by concurrent.futures.
+        """
+        import traceback
+        traceback.print_exc()
+

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30414>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to