Bump pyupgrade target to 3.10+
... according to the versions currently supported. Change-Id: I13138e4324c4f5fdb7cc5b0f963f417dfeb6f246 Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
@@ -26,4 +26,4 @@ repos:
|
||||
rev: v3.20.0
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: [--py3-only]
|
||||
args: [--py310-plus]
|
||||
|
||||
@@ -92,7 +92,7 @@ class Deserializer:
|
||||
if not buf:
|
||||
raise
|
||||
self.unpacker.feed(buf)
|
||||
except socket.timeout:
|
||||
except TimeoutError:
|
||||
pass
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ class ClientChannel:
|
||||
|
||||
reply = future.result()
|
||||
except Exception:
|
||||
LOG.warning("Unexpected error: {}".format(sys.exc_info()[0]))
|
||||
LOG.warning(f"Unexpected error: {sys.exc_info()[0]}")
|
||||
raise
|
||||
finally:
|
||||
del self.outstanding_msgs[myid]
|
||||
|
||||
@@ -223,7 +223,7 @@ class _ClientChannel(comm.ClientChannel):
|
||||
exc_type = importutils.import_class(result[1])
|
||||
if self.log_traceback:
|
||||
try:
|
||||
msg = 'Privsep daemon traceback: {}'.format(result[3])
|
||||
msg = f'Privsep daemon traceback: {result[3]}'
|
||||
self.log.warning(msg)
|
||||
except IndexError:
|
||||
pass
|
||||
@@ -493,7 +493,7 @@ class Daemon:
|
||||
'privsep: Exception during request[%(msgid)s]: '
|
||||
'%(err)s', {'msgid': msgid, 'err': e}, exc_info=True)
|
||||
cls = e.__class__
|
||||
cls_name = '{}.{}'.format(cls.__module__, cls.__name__)
|
||||
cls_name = f'{cls.__module__}.{cls.__name__}'
|
||||
return (comm.Message.ERR.value, cls_name, e.args,
|
||||
traceback.format_exc())
|
||||
|
||||
@@ -522,7 +522,7 @@ class Daemon:
|
||||
'privsep: Exception during request[%(msgid)s]: '
|
||||
'%(err)s', {'msgid': msgid, 'err': e}, exc_info=True)
|
||||
cls = e.__class__
|
||||
cls_name = '{}.{}'.format(cls.__module__, cls.__name__)
|
||||
cls_name = f'{cls.__module__}.{cls.__name__}'
|
||||
reply = (comm.Message.ERR.value, cls_name, e.args,
|
||||
traceback.format_exc())
|
||||
try:
|
||||
|
||||
@@ -257,7 +257,7 @@ class PrivContext:
|
||||
|
||||
def _wrap(self, func, *args, _wrap_timeout=None, **kwargs):
|
||||
if self.client_mode:
|
||||
name = '{}.{}'.format(func.__module__, func.__name__)
|
||||
name = f'{func.__module__}.{func.__name__}'
|
||||
if self.channel is not None and not self.channel.running:
|
||||
LOG.warning("RESTARTING PrivContext for %s", name)
|
||||
self.stop()
|
||||
|
||||
@@ -55,7 +55,7 @@ class CustomError(Exception):
|
||||
self.msg = msg
|
||||
|
||||
def __str__(self):
|
||||
return 'Code {}: {}'.format(self.code, self.msg)
|
||||
return f'Code {self.code}: {self.msg}'
|
||||
|
||||
|
||||
@testctx.context.entrypoint
|
||||
|
||||
Reference in New Issue
Block a user