Wraps possible unpickleable errors, so they can be safely sent through the socket.
| 78 | # |
| 79 | |
| 80 | class MaybeEncodingError(Exception): |
| 81 | """Wraps possible unpickleable errors, so they can be |
| 82 | safely sent through the socket.""" |
| 83 | |
| 84 | def __init__(self, exc, value): |
| 85 | self.exc = repr(exc) |
| 86 | self.value = repr(value) |
| 87 | super(MaybeEncodingError, self).__init__(self.exc, self.value) |
| 88 | |
| 89 | def __str__(self): |
| 90 | return "Error sending result: '%s'. Reason: '%s'" % (self.value, |
| 91 | self.exc) |
| 92 | |
| 93 | def __repr__(self): |
| 94 | return "<%s: %s>" % (self.__class__.__name__, self) |
| 95 | |
| 96 | |
| 97 | def worker(inqueue, outqueue, initializer=None, initargs=(), maxtasks=None, |
no outgoing calls
no test coverage detected
searching dependent graphs…