Coverage Report

Created: 2022-07-08 09:39

/home/mdboom/Work/builds/cpython/Modules/clinic/symtablemodule.c.h
Line
Count
Source (jump to first uncovered line)
1
/*[clinic input]
2
preserve
3
[clinic start generated code]*/
4
5
PyDoc_STRVAR(_symtable_symtable__doc__,
6
"symtable($module, source, filename, startstr, /)\n"
7
"--\n"
8
"\n"
9
"Return symbol and scope dictionaries used internally by compiler.");
10
11
#define _SYMTABLE_SYMTABLE_METHODDEF    \
12
    {"symtable", _PyCFunction_CAST(_symtable_symtable), METH_FASTCALL, _symtable_symtable__doc__},
13
14
static PyObject *
15
_symtable_symtable_impl(PyObject *module, PyObject *source,
16
                        PyObject *filename, const char *startstr);
17
18
static PyObject *
19
_symtable_symtable(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
20
{
21
    PyObject *return_value = NULL;
22
    PyObject *source;
23
    PyObject *filename;
24
    const char *startstr;
25
26
    if (!_PyArg_CheckPositional("symtable", nargs, 3, 3)) {
27
        goto exit;
28
    }
29
    source = args[0];
30
    if (!PyUnicode_FSDecoder(args[1], &filename)) {
  Branch (30:9): [True: 1, False: 15]
31
        goto exit;
32
    }
33
    if (!PyUnicode_Check(args[2])) {
  Branch (33:9): [True: 0, False: 15]
34
        _PyArg_BadArgument("symtable", "argument 3", "str", args[2]);
35
        goto exit;
36
    }
37
    Py_ssize_t startstr_length;
38
    startstr = PyUnicode_AsUTF8AndSize(args[2], &startstr_length);
39
    if (startstr == NULL) {
  Branch (39:9): [True: 0, False: 15]
40
        goto exit;
41
    }
42
    if (strlen(startstr) != (size_t)startstr_length) {
  Branch (42:9): [True: 0, False: 15]
43
        PyErr_SetString(PyExc_ValueError, "embedded null character");
44
        goto exit;
45
    }
46
    return_value = _symtable_symtable_impl(module, source, filename, startstr);
47
48
exit:
49
    return return_value;
50
}
51
/*[clinic end generated code: output=3f7ccf535d750238 input=a9049054013a1b77]*/