##// END OF EJS Templates
py3: paper over differences in future exception handling...
Augie Fackler -
r37687:1cb54e61 default
parent child Browse files
Show More
@@ -754,7 +754,8 b' class httpv2executor(object):'
754 754 try:
755 755 result.append(decoder.decode())
756 756 except Exception:
757 f.set_exception_info(*sys.exc_info()[1:])
757 pycompat.future_set_exception_info(
758 f, sys.exc_info()[1:])
758 759 continue
759 760 else:
760 761 result.append(meta['data'])
@@ -184,7 +184,7 b' class localcommandexecutor(object):'
184 184 try:
185 185 result = fn(**args)
186 186 except Exception:
187 f.set_exception_info(*sys.exc_info()[1:])
187 pycompat.future_set_exception_info(f, sys.exc_info()[1:])
188 188 else:
189 189 f.set_result(result)
190 190
@@ -28,6 +28,9 b' if not ispy3:'
28 28 import xmlrpclib
29 29
30 30 from .thirdparty.concurrent import futures
31
32 def future_set_exception_info(f, exc_info):
33 f.set_exception_info(*exc_info)
31 34 else:
32 35 import concurrent.futures as futures
33 36 import http.cookiejar as cookielib
@@ -37,6 +40,9 b' else:'
37 40 import socketserver
38 41 import xmlrpc.client as xmlrpclib
39 42
43 def future_set_exception_info(f, exc_info):
44 f.set_exception(exc_info[0])
45
40 46 empty = _queue.Empty
41 47 queue = _queue.Queue
42 48
@@ -209,7 +209,7 b' class peerexecutor(object):'
209 209 try:
210 210 result = fn(**pycompat.strkwargs(args))
211 211 except Exception:
212 f.set_exception_info(*sys.exc_info()[1:])
212 pycompat.future_set_exception_info(f, sys.exc_info()[1:])
213 213 else:
214 214 f.set_result(result)
215 215
@@ -234,14 +234,14 b' class peerexecutor(object):'
234 234 batchable = fn.batchable(fn.__self__,
235 235 **pycompat.strkwargs(args))
236 236 except Exception:
237 f.set_exception_info(*sys.exc_info()[1:])
237 pycompat.future_set_exception_info(f, sys.exc_info()[1:])
238 238 return
239 239
240 240 # Encoded arguments and future holding remote result.
241 241 try:
242 242 encodedargs, fremote = next(batchable)
243 243 except Exception:
244 f.set_exception_info(*sys.exc_info()[1:])
244 pycompat.future_set_exception_info(f, sys.exc_info()[1:])
245 245 return
246 246
247 247 requests.append((command, encodedargs))
@@ -304,7 +304,7 b' class peerexecutor(object):'
304 304 try:
305 305 result = next(batchable)
306 306 except Exception:
307 f.set_exception_info(*sys.exc_info()[1:])
307 pycompat.future_set_exception_info(f, sys.exc_info()[1:])
308 308 else:
309 309 f.set_result(result)
310 310
General Comments 0
You need to be logged in to leave comments. Login now