-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor to use rpy2 local converter
- Loading branch information
Showing
4 changed files
with
64 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from threading import Thread | ||
|
||
class PropagatingThread(Thread): | ||
def run(self): | ||
self.exc = None | ||
try: | ||
if hasattr(self, '_Thread__target'): | ||
# Thread uses name mangling prior to Python 3. | ||
self.ret = self._Thread__target(*self._Thread__args, **self._Thread__kwargs) | ||
else: | ||
self.ret = self._target(*self._args, **self._kwargs) | ||
except BaseException as e: | ||
self.exc = e | ||
|
||
def join(self, timeout=None): | ||
super(PropagatingThread, self).join(timeout) | ||
if self.exc: | ||
raise self.exc | ||
return self.ret |