aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/samplebinding/simplefile_glue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/tests/samplebinding/simplefile_glue.cpp')
-rw-r--r--sources/shiboken6/tests/samplebinding/simplefile_glue.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/sources/shiboken6/tests/samplebinding/simplefile_glue.cpp b/sources/shiboken6/tests/samplebinding/simplefile_glue.cpp
new file mode 100644
index 000000000..76c0cfaf2
--- /dev/null
+++ b/sources/shiboken6/tests/samplebinding/simplefile_glue.cpp
@@ -0,0 +1,9 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+if (!%CPPSELF.%FUNCTION_NAME()) {
+ PyObject* error_msg = PyBytes_FromFormat(
+ "Could not open file: \"%s\"", %CPPSELF->filename());
+ PyErr_SetObject(PyExc_IOError, error_msg);
+ return 0;
+}