Update target python version for pyupgrade

Python <= 3.10 is no longer supported.

Change-Id: I1ea6c7d80a9ad46ad0b2651301d4846f9fbf2a9e
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
Takashi Kajinami committed 2026-09-25 00:41:21 +09:00
1 parent 58e52118f8
commit 573d55ae4e
6 files changed
+9 -9

No files matched your search

+1 -1
View File
@@ -22,4 +22,4 @@ repos:
rev: v3.21.2
hooks:
- id: pyupgrade
args: [--py3-only]
args: [--py311-plus]
+1 -1
View File
@@ -41,7 +41,7 @@ def process_jobs():
claim1 = queue.claim(ttl=500, grace=900, limit=2)
for msg in claim1:
claim_id = msg.claim_id
print('{claim_id} =? {id}'.format(claim_id=claim_id, id=claim1.id))
print(f'{claim_id} =? {claim1.id}')
print('processing job %s' % (msg))
msg.delete()
time.sleep(0.5)
+1 -1
View File
@@ -34,7 +34,7 @@ def get_transport(transport='http', version=2, options=None):
:rtype: `zaqarclient.transport.Transport`
"""
entry_point = '{}.v{}'.format(transport, version)
entry_point = f'{transport}.v{version}'
try:
namespace = 'zaqarclient.transport'
+1 -1
View File
@@ -52,7 +52,7 @@ class Api:
return self.schema[operation]
except KeyError:
# TODO(flaper87): gettext support
msg = '{} is not a valid operation'.format(operation)
msg = f'{operation} is not a valid operation'
raise errors.InvalidOperation(msg)
def validate(self, operation, params):
+4 -4
View File
@@ -33,13 +33,13 @@ class TransportError(errors.ZaqarError):
code = None
def __init__(self, title=None, description=None, text=None):
msg = 'Error response from Zaqar. Code: {}.'.format(self.code)
msg = f'Error response from Zaqar. Code: {self.code}.'
if title:
msg += ' Title: {}.'.format(title)
msg += f' Title: {title}.'
if description:
msg += ' Description: {}.'.format(description)
msg += f' Description: {description}.'
if text:
msg += ' Text: {}.'.format(text)
msg += f' Text: {text}.'
super().__init__(msg)
+1 -1
View File
@@ -54,7 +54,7 @@ class HttpTransport(base.Transport):
ref = ref.lstrip('/' + request.api.label)
for param in list(request.params.keys()):
if '{{{0}}}'.format(param) in ref:
if f'{{{param}}}' in ref:
value = request.params.pop(param)
# NOTE(flaper87): Zaqar API parses