Skip to content

Commit b11b71b

Browse files
hugovkionelmc
authored andcommitted
Upgrade syntax for Python 3.10+
1 parent 410b72b commit b11b71b

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

ci/bootstrap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def main():
5757
# This uses sys.executable the same way that the call in
5858
# cookiecutter-pylibrary/hooks/post_gen_project.py
5959
# invokes this bootstrap.py itself.
60-
for line in subprocess.check_output([sys.executable, '-m', 'tox', '--listenvs'], universal_newlines=True).splitlines()
60+
for line in subprocess.check_output([sys.executable, '-m', 'tox', '--listenvs'], text=True).splitlines()
6161
]
6262
tox_environments = [line for line in tox_environments if line.startswith('py')]
6363
for template in templates_path.rglob('*'):

src/pytest_benchmark/fixture.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from .utils import slugify
2020

2121
statistics: typing.Any
22-
statistics_error: typing.Optional[str] = None
22+
statistics_error: str | None = None
2323
try:
2424
import statistics
2525
except (ImportError, SyntaxError):

src/pytest_benchmark/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def in_any_parent(name, path=None):
127127

128128

129129
def subprocess_output(cmd):
130-
return check_output(cmd.split(), stderr=subprocess.STDOUT, universal_newlines=True).strip()
130+
return check_output(cmd.split(), stderr=subprocess.STDOUT, text=True).strip()
131131

132132

133133
def get_commit_info(project_name=None):

tests/test_storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
list(normalize_stats(bench['stats']) for bench in JSON_DATA['benchmarks'])
3737

3838

39-
class Namespace(object):
39+
class Namespace:
4040
def __init__(self, **kwargs):
4141
self.__dict__.update(kwargs)
4242

0 commit comments

Comments
 (0)