remove six.reraise python3
authorGP Orcullo <kinsamanka@gmail.com>
Fri, 28 Oct 2022 15:56:01 +0800
branchpython3
changeset 3753 5256e4bd92e6
parent 3752 9f6f46dbe3ae
child 3754 98a76dbb1b6d
remove six.reraise
runtime/Worker.py
--- a/runtime/Worker.py	Fri Oct 28 14:07:13 2022 +0800
+++ b/runtime/Worker.py	Fri Oct 28 15:56:01 2022 +0800
@@ -8,11 +8,9 @@
 # See COPYING.Runtime file for copyrights details.
 
 
-import sys
 from threading import Lock, Condition, Thread
 
-import six
-from six.moves import _thread
+import _thread
 
 
 class job(object):
@@ -33,9 +31,9 @@
             call, args, kwargs = self.job
             self.result = call(*args, **kwargs)
             self.success = True
-        except Exception:
+        except Exception as e:
             self.success = False
-            self.exc_info = sys.exc_info()
+            self.exc_info = e
 
 
 class worker(object):
@@ -60,10 +58,7 @@
         reraise exception happend in a job
         @param job: job where original exception happend
         """
-        exc_type = job.exc_info[0]
-        exc_value = job.exc_info[1]
-        exc_traceback = job.exc_info[2]
-        six.reraise(exc_type, exc_value, exc_traceback)
+        raise job.exc_info
 
     def runloop(self, *args, **kwargs):
         """