Skip to content

Commit

Permalink
Merge pull request #260 from SpiNNakerManchester/pylint
Browse files Browse the repository at this point in the history
Pylint
  • Loading branch information
rowleya committed Jan 18, 2022
2 parents 4f2beb8 + 3d35186 commit 6d779a8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion spinnman/connections/scp_request_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def _get_next_sequence_number(self):
:return: The next number in the sequence.
:rtype: int
"""
global _next_sequence, _next_sequence_lock
global _next_sequence
with _next_sequence_lock:
sequence = _next_sequence
_next_sequence = (sequence + 1) % MAX_SEQUENCE
Expand Down
2 changes: 1 addition & 1 deletion spinnman/processes/get_machine_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,5 +526,5 @@ def _report_ignore(self, message, *args):
self._report_file = join(
self._default_report_directory, REPORT_FILE)

with open(self._report_file, "a") as r_file:
with open(self._report_file, "a", encoding="utf-8") as r_file:
r_file.write(full_message)
2 changes: 1 addition & 1 deletion spinnman/utilities/locate_connected_machine_ip_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _ctrlc_handler(sig, frame): # @UnusedVariable
def _print_connected(ip_address, timestamp):
try:
hostname = f" ({socket.gethostbyaddr(ip_address)[0]})"
except Exception:
except Exception: # pylint: disable=broad-except
hostname = ""
print(f"{ip_address}{hostname} at {timestamp}")
return False
Expand Down
2 changes: 1 addition & 1 deletion spinnman/utilities/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def generate_machine_report(report_directory, machine, connections):
file_name = os.path.join(report_directory, _REPORT_NAME)
time_date_string = time.strftime("%c")
try:
with open(file_name, "w") as f:
with open(file_name, "w", encoding="utf-8") as f:
_write_header(f, time_date_string, machine, connections)
# TODO: Add further details on the target machine.
for chip in machine.chips:
Expand Down

0 comments on commit 6d779a8

Please sign in to comment.