1010import time
1111from enum import Enum
1212from textwrap import dedent
13- from typing import IO , AnyStr , Callable , List , TextIO
13+ from typing import IO , AnyStr , Callable , List
1414
1515from 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" :
0 commit comments