aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/samplebinding/simplefile_glue.cpp
blob: 76c0cfaf2a1aef89dc0c1c76b7c1ec53e91e39e5 (plain)
1
2
3
4
5
6
7
8
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;
}