Skip to content

Commit 8b4a78f

Browse files
committed
EPySystemExit was not fully specified.
1 parent 179b7a6 commit 8b4a78f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Source/PythonEngine.pas

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5570,9 +5570,7 @@ procedure TPythonEngine.RaiseError;
55705570
s_type := GetTypeAsString(err_type);
55715571
s_value := PyObjectAsString(err_value);
55725572

5573-
if (PyErr_GivenExceptionMatches(err_type, PyExc_SystemExit^) <> 0) then
5574-
raise Define( EPySystemExit.Create(''), s_type, s_value )
5575-
else if (PyErr_GivenExceptionMatches(err_type, PyExc_StopIteration^) <> 0) then
5573+
if (PyErr_GivenExceptionMatches(err_type, PyExc_StopIteration^) <> 0) then
55765574
raise Define( EPyStopIteration.Create(''), s_type, s_value )
55775575
else if (PyErr_GivenExceptionMatches(err_type, PyExc_KeyboardInterrupt^) <> 0) then
55785576
raise Define( EPyKeyboardInterrupt.Create(''), s_type, s_value )
@@ -6606,6 +6604,7 @@ procedure TPythonEngine.CheckError(ACatchStopEx : Boolean = False);
66066604
var
66076605
errtype, errvalue, errtraceback: PPyObject;
66086606
SErrValue: string;
6607+
SystemExit: EPySystemExit;
66096608
begin
66106609
// PyErr_Fetch clears the error. The returned python objects are new references
66116610
PyErr_Fetch(errtype, errvalue, errtraceback);
@@ -6614,7 +6613,11 @@ procedure TPythonEngine.CheckError(ACatchStopEx : Boolean = False);
66146613
Py_XDECREF(errtype);
66156614
Py_XDECREF(errvalue);
66166615
Py_XDECREF(errtraceback);
6617-
raise EPySystemExit.CreateResFmt(@SPyExcSystemError, [SErrValue]);
6616+
6617+
SystemExit := EPySystemExit.CreateResFmt(@SPyExcSystemError, [SErrValue]);
6618+
SystemExit.EValue := SErrValue;
6619+
SystemExit.EName := 'SystemExit';
6620+
raise SystemExit;
66186621
end;
66196622

66206623
var

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy