File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -4313,10 +4313,14 @@ procedure TPythonEngine.Finalize;
43134313 begin
43144314 RedirectIO := False;
43154315 // restore the initial streams also.
4316- ExecString(' import sys' +LF+
4317- ' if hasattr(sys, "old_stdin"): sys.stdin=sys.old_stdin' +LF+
4318- ' if hasattr(sys, "old_stdout"): sys.stdout=sys.old_stdout' +LF+
4319- ' if hasattr(sys, "old_stderr"): sys.stderr=sys.old_stderr' );
4316+ try
4317+ ExecString(' import sys' +LF+
4318+ ' if hasattr(sys, "old_stdin"): sys.stdin=sys.old_stdin' +LF+
4319+ ' if hasattr(sys, "old_stdout"): sys.stdout=sys.old_stdout' +LF+
4320+ ' if hasattr(sys, "old_stderr"): sys.stderr=sys.old_stderr' );
4321+ except
4322+ // Exception if a script error occurred previously. e.g. in CheckExecSyntax with incorrect syntax.
4323+ end ;
43204324 end ;
43214325 // First finalize our clients
43224326 if Initialized then
You can’t perform that action at this time.
0 commit comments