diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-08-02 13:16:47 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-08-02 20:53:04 +0200 |
| commit | 1b0134fd104cb710bc9d619c22fd0bacc0832c05 (patch) | |
| tree | 7c22ce8c8bec9a4058033500fed9d8c2382b9610 /sources/shiboken6/tests/libsample/exceptiontest.cpp | |
| parent | bc7face18376b52e99079d633da610adc5cc57ef (diff) | |
shiboken6: Propagate exceptions through return value ownership modifications
The code for modifying return value ownership clears errors set by
PyErr_SetString(). To work around this, store the error type and
the message in variables and set the error at the end of the code block.
Fixes: PYSIDE-1995
Change-Id: I45816197117a3b409fd549e89d57f7b9f0eac458
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/tests/libsample/exceptiontest.cpp')
| -rw-r--r-- | sources/shiboken6/tests/libsample/exceptiontest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sources/shiboken6/tests/libsample/exceptiontest.cpp b/sources/shiboken6/tests/libsample/exceptiontest.cpp index 35da4e90b..56144e086 100644 --- a/sources/shiboken6/tests/libsample/exceptiontest.cpp +++ b/sources/shiboken6/tests/libsample/exceptiontest.cpp @@ -37,3 +37,10 @@ void ExceptionTest::voidThrowInt(bool doThrow) if (doThrow) throw 42; } + +ExceptionTest *ExceptionTest::create(bool doThrow) +{ + if (doThrow) + throw TestException(); + return new ExceptionTest; +} |
