Skip to content

Commit

Permalink
Changes made by pyupgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
samdoran committed Mar 15, 2023
1 parent ab7cd9a commit 17d8f3f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dev/scripts/log_timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def handle_log(self, log_file_name):
def open_dump_file(self):
# LOG.critical(f"DUMP = {self.dump}")
if self.dump:
return open(self.dump[0], "wt")
return open(self.dump[0], "w")
return sys.stdout

def get_error_log_ts_start_end(self):
Expand Down
2 changes: 1 addition & 1 deletion dev/scripts/update_e2e_srr.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def repl(match):

target_file = os.path.join(os.environ["E2E_REPO"], "buildfactory", yaml_file_name)
LOG.info(f'Processing "{target_file}"')
with open(target_file, "rt+") as e2e_yaml:
with open(target_file, "r+") as e2e_yaml:
buff = e2e_yaml.read()
e2e_yaml.seek(0)
e2e_yaml.write(SRR.sub(repl, buff))
Expand Down
2 changes: 1 addition & 1 deletion koku/api/report/test/test_query_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
#
"""Test the QueryFilter."""
from collections import Iterable
from collections.abc import Iterable

from django.db.models import Q
from django.test import TestCase
Expand Down
4 changes: 2 additions & 2 deletions koku/koku/test_migration_sql_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_apply_sql_file(self):
"""
filename = "./___test_apply_sql_file.sql"
try:
with open(filename, "wt") as f:
with open(filename, "w") as f:
print("select 1;", file=f)
self.assertEqual(msh.apply_sql_file(conn.schema_editor(), filename), True)
finally:
Expand All @@ -38,7 +38,7 @@ def test_no_apply_sql_file(self):
"""
filename = "./___test_apply_sql_file.sql"
try:
with open(filename, "wt") as f:
with open(filename, "w") as f:
print("select 1;", file=f)
with self.assertRaises(TypeError):
msh.apply_sql_file(None, filename)
Expand Down
2 changes: 1 addition & 1 deletion koku/sources/test/test_kafka_message_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def test_create_msg_processor_various_headers_failures(self):
"header_list": (
("event_type", bytes(event, encoding="utf-8")),
("x-rh-identity", bytes(header_missing_account_number, encoding="utf-8")),
("x-rh-sources-account-number", bytes()),
("x-rh-sources-account-number", b''),
)
},
]
Expand Down

0 comments on commit 17d8f3f

Please sign in to comment.