Skip to content

Commit e23ebd4

Browse files
author
Elias Werner
committed
linter fixes, we should finally set up pre commit hooks for that...
1 parent aa93005 commit e23ebd4

2 files changed

Lines changed: 16 additions & 9 deletions

File tree

src/scorep_jupyter/kernel.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import time
1111
from enum import Enum
1212
from textwrap import dedent
13-
from typing import IO, AnyStr, Callable, List, TextIO
13+
from typing import IO, AnyStr, Callable, List
1414

1515
from ipykernel.ipkernel import IPythonKernel
1616

@@ -571,7 +571,7 @@ async def scorep_execute(
571571
self.log_error(
572572
KernelErrorCode.PERSISTENCE_LOAD_FAIL,
573573
direction="Score-P -> Jupyter",
574-
optional_hint = get_scorep_process_error_hint()
574+
optional_hint=get_scorep_process_error_hint(),
575575
)
576576
return self.standard_reply()
577577

@@ -590,7 +590,7 @@ async def scorep_execute(
590590
self.log_error(
591591
KernelErrorCode.PERSISTENCE_LOAD_FAIL,
592592
direction="Score-P -> Jupyter",
593-
optional_hint = get_scorep_process_error_hint()
593+
optional_hint=get_scorep_process_error_hint(),
594594
)
595595
self.pershelper.postprocess()
596596
return reply_status_update
@@ -666,10 +666,17 @@ def start_reading_scorep_process_streams(
666666
)
667667

668668
captured_stdout: List[str] = []
669-
captured_stderr: List[str] = [] # Output parameter (return not possible from thread)
669+
captured_stderr: List[str] = (
670+
[]
671+
) # Output parameter (return not possible from thread)
670672
t_stderr = threading.Thread(
671673
target=self.read_scorep_stderr,
672-
args=(proc.stderr, stdout_lock, spinner_stop_event, captured_stderr),
674+
args=(
675+
proc.stderr,
676+
stdout_lock,
677+
spinner_stop_event,
678+
captured_stderr,
679+
),
673680
)
674681

675682
# Empty cell output, required for interactive output
@@ -692,7 +699,8 @@ def start_reading_scorep_process_streams(
692699
t_stderr.join()
693700
process_busy_spinner.stop(spinner_message)
694701

695-
# Handle recorded output (in case if it is suppressed by spinner animation)
702+
# Handle recorded output
703+
# (in case if it is suppressed by spinner animation)
696704
self.handle_captured_output(captured_stdout, stream="stdout")
697705
self.handle_captured_output(captured_stderr, stream="stderr")
698706

@@ -733,7 +741,7 @@ def read_scorep_stderr(
733741
def process_stderr_line(line: str):
734742
if spinner_stop_event.is_set():
735743
self.log.error(line.strip())
736-
self.cell_output(line, 'stderr')
744+
self.cell_output(line, "stderr")
737745
else:
738746
captured_stderr.append(line)
739747

@@ -769,7 +777,7 @@ def read_scorep_stream(
769777

770778
def handle_captured_output(self, output: List[str], stream: str):
771779
if output:
772-
text_output = "".join(output)
780+
text_output = "".join(output)
773781
if stream == "stdout":
774782
self.cell_output(text_output, stream=stream)
775783
elif stream == "stderr":

src/scorep_jupyter/kernel_messages.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
from enum import Enum, auto
32

43
from .logging_config import LOGGING

0 commit comments

Comments
 (0)