Bump pyupgrade target to 3.10+

... according to the versions currently supported.

Change-Id: Ia1b0efc641149de8c5e9be9c2379f0b683e68976
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
Takashi Kajinami
2025-10-05 19:39:13 +09:00
parent b7e9aa6aaf
commit 2c60cb2dd8
4 changed files with 7 additions and 7 deletions

View File

@@ -26,4 +26,4 @@ repos:
rev: v3.20.0
hooks:
- id: pyupgrade
args: [--py3-only]
args: [--py310-plus]

View File

@@ -179,7 +179,7 @@ class GuruMeditation:
mtime = stat.st_mtime
except OSError:
msg = ("Guru Meditation Report cannot read " +
"'{}' file".format(filepath))
f"'{filepath}' file")
raise OSError(msg)
finally:
time.sleep(interval)

View File

@@ -48,7 +48,7 @@ class BasicKeyValueView:
def __call__(self, model):
res = ""
for key in sorted(model):
res += "{key} = {value}\n".format(key=key, value=model[key])
res += f"{key} = {model[key]}\n"
return res
@@ -173,7 +173,7 @@ class TableView:
self.column_width = (72 - len(column_names) + 1) // len(column_names)
column_headers = "|".join(
"{{ch[{n}]: ^{width}}}".format(n=n, width=self.column_width)
f"{{ch[{n}]: ^{self.column_width}}}"
for n in range(len(column_names))
)
@@ -186,7 +186,7 @@ class TableView:
self.header_fmt_str = column_headers + "\n" + vert_divider + "\n"
self.row_fmt_str = "|".join(
"{{cv[{n}]: ^{width}}}".format(n=n, width=self.column_width)
f"{{cv[{n}]: ^{self.column_width}}}"
for n in range(len(column_values))
)
@@ -196,6 +196,6 @@ class TableView:
row = [str(raw_row[prop_name])
for prop_name in self.column_values]
# double format is in case we have roundoff error
res += '{: <72}\n'.format(self.row_fmt_str.format(cv=row))
res += f'{self.row_fmt_str.format(cv=row): <72}\n'
return res

View File

@@ -75,6 +75,6 @@ class ThreadView:
def __call__(self, model):
return self.FORMAT_STR.format(
thread_str=" Thread #{} ".format(model.thread_id),
thread_str=f" Thread #{model.thread_id} ",
stack_trace=model.stack_trace
)