Lines Matching refs:name
32 /* Get the variable part of a module's export symbol name.
33 * Returns a bytes instance. For non-ASCII-named modules, the name is
39 get_encoded_name(PyObject *name, const char **hook_prefix) {
45 /* Get the short name (substring after last dot) */
46 name_len = PyUnicode_GetLength(name);
50 lastdot = PyUnicode_FindChar(name, '.', 0, name_len, -1);
54 tmp = PyUnicode_Substring(name, lastdot + 1, name_len);
57 name = tmp;
58 /* "name" now holds a new reference to the substring */
60 Py_INCREF(name);
64 encoded = PyUnicode_AsEncodedString(name, "ascii", NULL);
70 encoded = PyUnicode_AsEncodedString(name, "punycode", NULL);
85 Py_DECREF(name);
89 Py_DECREF(name);
100 PyObject *name_unicode = NULL, *name = NULL, *path = NULL, *m = NULL;
107 name_unicode = PyObject_GetAttrString(spec, "name");
113 "spec.name must be a string");
117 name = get_encoded_name(name_unicode, &hook_prefix);
118 if (name == NULL) {
121 name_buf = PyBytes_AS_STRING(name);
201 Py_DECREF(name);
237 Py_DECREF(name);
244 Py_XDECREF(name);