summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMachinexa2 <darkwebmachine@gmail.com>2021-06-08 09:47:15 (GMT)
committerGitHub <noreply@github.com>2021-06-08 09:47:15 (GMT)
commitd56e700d6c7ebf1a424260d0e4f0c291d1f5b3af (patch)
treeb264c2fb724e016c3433222e4f3b788e9cb2eebf
parent227a09325e7bf82ecd303b4696c054a086b29a00 (diff)
downloadcpython-d56e700d6c7ebf1a424260d0e4f0c291d1f5b3af.zip
cpython-d56e700d6c7ebf1a424260d0e4f0c291d1f5b3af.tar.gz
cpython-d56e700d6c7ebf1a424260d0e4f0c291d1f5b3af.tar.bz2
Use `from` imports (GH-26594)
from imports
-rw-r--r--Lib/concurrent/futures/process.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/concurrent/futures/process.py b/Lib/concurrent/futures/process.py
index 7647198..9904db7 100644
--- a/Lib/concurrent/futures/process.py
+++ b/Lib/concurrent/futures/process.py
@@ -56,7 +56,7 @@ import weakref
from functools import partial
import itertools
import sys
-import traceback
+from traceback import format_exception
_threads_wakeups = weakref.WeakKeyDictionary()
@@ -123,8 +123,7 @@ class _RemoteTraceback(Exception):
class _ExceptionWithTraceback:
def __init__(self, exc, tb):
- tb = traceback.format_exception(type(exc), exc, tb)
- tb = ''.join(tb)
+ tb = ''.join(format_exception(type(exc), exc, tb))
self.exc = exc
self.tb = '\n"""\n%s"""' % tb
def __reduce__(self):
@@ -166,7 +165,7 @@ class _SafeQueue(Queue):
def _on_queue_feeder_error(self, e, obj):
if isinstance(obj, _CallItem):
- tb = traceback.format_exception(type(e), e, e.__traceback__)
+ tb = format_exception(type(e), e, e.__traceback__)
e.__cause__ = _RemoteTraceback('\n"""\n{}"""'.format(''.join(tb)))
work_item = self.pending_work_items.pop(obj.work_id, None)
with self.shutdown_lock:
@@ -384,7 +383,7 @@ class _ExecutorManagerThread(threading.Thread):
result_item = result_reader.recv()
is_broken = False
except BaseException as e:
- cause = traceback.format_exception(type(e), e, e.__traceback__)
+ cause = format_exception(type(e), e, e.__traceback__)
elif wakeup_reader in ready:
is_broken = False