diff mbox

[KVM-AUTOTEST,v3,05/11] KVM test: Thread.join(): insert the current context into the thread's exception

Message ID 1294426091-16704-5-git-send-email-mgoldish@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael Goldish Jan. 7, 2011, 6:48 p.m. UTC
None
diff mbox

Patch

diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py
index 646d4fa..6cfed3f 100644
--- a/client/tests/kvm/kvm_utils.py
+++ b/client/tests/kvm/kvm_utils.py
@@ -1179,6 +1179,11 @@  class Thread(threading.Thread):
         threading.Thread.join(self, timeout)
         try:
             if self._e:
+                # Because the exception was raised in another thread, we need
+                # to explicitly insert the current context into it
+                s = error.exception_context(self._e[1])
+                s = error.join_contexts(error.get_context(), s)
+                error.set_exception_context(self._e[1], s)
                 raise self._e[0], self._e[1], self._e[2]
             else:
                 return self._retval