mirror of
https://github.com/python/cpython.git
synced 2025-07-19 09:15:34 +00:00
Rename _Py_identifier to _Py_IDENTIFIER.
This commit is contained in:
parent
01277d166a
commit
bd928fef42
57 changed files with 262 additions and 262 deletions
|
@ -7,7 +7,7 @@ static PyTypeObject AST_type;
|
|||
static PyTypeObject *mod_type;
|
||||
static PyObject* ast2obj_mod(void*);
|
||||
static PyTypeObject *Module_type;
|
||||
_Py_identifier(body);
|
||||
_Py_IDENTIFIER(body);
|
||||
static char *Module_fields[]={
|
||||
"body",
|
||||
};
|
||||
|
@ -24,18 +24,18 @@ static char *Suite_fields[]={
|
|||
"body",
|
||||
};
|
||||
static PyTypeObject *stmt_type;
|
||||
_Py_identifier(lineno);
|
||||
_Py_identifier(col_offset);
|
||||
_Py_IDENTIFIER(lineno);
|
||||
_Py_IDENTIFIER(col_offset);
|
||||
static char *stmt_attributes[] = {
|
||||
"lineno",
|
||||
"col_offset",
|
||||
};
|
||||
static PyObject* ast2obj_stmt(void*);
|
||||
static PyTypeObject *FunctionDef_type;
|
||||
_Py_identifier(name);
|
||||
_Py_identifier(args);
|
||||
_Py_identifier(decorator_list);
|
||||
_Py_identifier(returns);
|
||||
_Py_IDENTIFIER(name);
|
||||
_Py_IDENTIFIER(args);
|
||||
_Py_IDENTIFIER(decorator_list);
|
||||
_Py_IDENTIFIER(returns);
|
||||
static char *FunctionDef_fields[]={
|
||||
"name",
|
||||
"args",
|
||||
|
@ -44,10 +44,10 @@ static char *FunctionDef_fields[]={
|
|||
"returns",
|
||||
};
|
||||
static PyTypeObject *ClassDef_type;
|
||||
_Py_identifier(bases);
|
||||
_Py_identifier(keywords);
|
||||
_Py_identifier(starargs);
|
||||
_Py_identifier(kwargs);
|
||||
_Py_IDENTIFIER(bases);
|
||||
_Py_IDENTIFIER(keywords);
|
||||
_Py_IDENTIFIER(starargs);
|
||||
_Py_IDENTIFIER(kwargs);
|
||||
static char *ClassDef_fields[]={
|
||||
"name",
|
||||
"bases",
|
||||
|
@ -58,12 +58,12 @@ static char *ClassDef_fields[]={
|
|||
"decorator_list",
|
||||
};
|
||||
static PyTypeObject *Return_type;
|
||||
_Py_identifier(value);
|
||||
_Py_IDENTIFIER(value);
|
||||
static char *Return_fields[]={
|
||||
"value",
|
||||
};
|
||||
static PyTypeObject *Delete_type;
|
||||
_Py_identifier(targets);
|
||||
_Py_IDENTIFIER(targets);
|
||||
static char *Delete_fields[]={
|
||||
"targets",
|
||||
};
|
||||
|
@ -73,16 +73,16 @@ static char *Assign_fields[]={
|
|||
"value",
|
||||
};
|
||||
static PyTypeObject *AugAssign_type;
|
||||
_Py_identifier(target);
|
||||
_Py_identifier(op);
|
||||
_Py_IDENTIFIER(target);
|
||||
_Py_IDENTIFIER(op);
|
||||
static char *AugAssign_fields[]={
|
||||
"target",
|
||||
"op",
|
||||
"value",
|
||||
};
|
||||
static PyTypeObject *For_type;
|
||||
_Py_identifier(iter);
|
||||
_Py_identifier(orelse);
|
||||
_Py_IDENTIFIER(iter);
|
||||
_Py_IDENTIFIER(orelse);
|
||||
static char *For_fields[]={
|
||||
"target",
|
||||
"iter",
|
||||
|
@ -90,7 +90,7 @@ static char *For_fields[]={
|
|||
"orelse",
|
||||
};
|
||||
static PyTypeObject *While_type;
|
||||
_Py_identifier(test);
|
||||
_Py_IDENTIFIER(test);
|
||||
static char *While_fields[]={
|
||||
"test",
|
||||
"body",
|
||||
|
@ -103,21 +103,21 @@ static char *If_fields[]={
|
|||
"orelse",
|
||||
};
|
||||
static PyTypeObject *With_type;
|
||||
_Py_identifier(items);
|
||||
_Py_IDENTIFIER(items);
|
||||
static char *With_fields[]={
|
||||
"items",
|
||||
"body",
|
||||
};
|
||||
static PyTypeObject *Raise_type;
|
||||
_Py_identifier(exc);
|
||||
_Py_identifier(cause);
|
||||
_Py_IDENTIFIER(exc);
|
||||
_Py_IDENTIFIER(cause);
|
||||
static char *Raise_fields[]={
|
||||
"exc",
|
||||
"cause",
|
||||
};
|
||||
static PyTypeObject *Try_type;
|
||||
_Py_identifier(handlers);
|
||||
_Py_identifier(finalbody);
|
||||
_Py_IDENTIFIER(handlers);
|
||||
_Py_IDENTIFIER(finalbody);
|
||||
static char *Try_fields[]={
|
||||
"body",
|
||||
"handlers",
|
||||
|
@ -125,19 +125,19 @@ static char *Try_fields[]={
|
|||
"finalbody",
|
||||
};
|
||||
static PyTypeObject *Assert_type;
|
||||
_Py_identifier(msg);
|
||||
_Py_IDENTIFIER(msg);
|
||||
static char *Assert_fields[]={
|
||||
"test",
|
||||
"msg",
|
||||
};
|
||||
static PyTypeObject *Import_type;
|
||||
_Py_identifier(names);
|
||||
_Py_IDENTIFIER(names);
|
||||
static char *Import_fields[]={
|
||||
"names",
|
||||
};
|
||||
static PyTypeObject *ImportFrom_type;
|
||||
_Py_identifier(module);
|
||||
_Py_identifier(level);
|
||||
_Py_IDENTIFIER(module);
|
||||
_Py_IDENTIFIER(level);
|
||||
static char *ImportFrom_fields[]={
|
||||
"module",
|
||||
"names",
|
||||
|
@ -165,21 +165,21 @@ static char *expr_attributes[] = {
|
|||
};
|
||||
static PyObject* ast2obj_expr(void*);
|
||||
static PyTypeObject *BoolOp_type;
|
||||
_Py_identifier(values);
|
||||
_Py_IDENTIFIER(values);
|
||||
static char *BoolOp_fields[]={
|
||||
"op",
|
||||
"values",
|
||||
};
|
||||
static PyTypeObject *BinOp_type;
|
||||
_Py_identifier(left);
|
||||
_Py_identifier(right);
|
||||
_Py_IDENTIFIER(left);
|
||||
_Py_IDENTIFIER(right);
|
||||
static char *BinOp_fields[]={
|
||||
"left",
|
||||
"op",
|
||||
"right",
|
||||
};
|
||||
static PyTypeObject *UnaryOp_type;
|
||||
_Py_identifier(operand);
|
||||
_Py_IDENTIFIER(operand);
|
||||
static char *UnaryOp_fields[]={
|
||||
"op",
|
||||
"operand",
|
||||
|
@ -196,19 +196,19 @@ static char *IfExp_fields[]={
|
|||
"orelse",
|
||||
};
|
||||
static PyTypeObject *Dict_type;
|
||||
_Py_identifier(keys);
|
||||
_Py_IDENTIFIER(keys);
|
||||
static char *Dict_fields[]={
|
||||
"keys",
|
||||
"values",
|
||||
};
|
||||
static PyTypeObject *Set_type;
|
||||
_Py_identifier(elts);
|
||||
_Py_IDENTIFIER(elts);
|
||||
static char *Set_fields[]={
|
||||
"elts",
|
||||
};
|
||||
static PyTypeObject *ListComp_type;
|
||||
_Py_identifier(elt);
|
||||
_Py_identifier(generators);
|
||||
_Py_IDENTIFIER(elt);
|
||||
_Py_IDENTIFIER(generators);
|
||||
static char *ListComp_fields[]={
|
||||
"elt",
|
||||
"generators",
|
||||
|
@ -219,7 +219,7 @@ static char *SetComp_fields[]={
|
|||
"generators",
|
||||
};
|
||||
static PyTypeObject *DictComp_type;
|
||||
_Py_identifier(key);
|
||||
_Py_IDENTIFIER(key);
|
||||
static char *DictComp_fields[]={
|
||||
"key",
|
||||
"value",
|
||||
|
@ -235,15 +235,15 @@ static char *Yield_fields[]={
|
|||
"value",
|
||||
};
|
||||
static PyTypeObject *Compare_type;
|
||||
_Py_identifier(ops);
|
||||
_Py_identifier(comparators);
|
||||
_Py_IDENTIFIER(ops);
|
||||
_Py_IDENTIFIER(comparators);
|
||||
static char *Compare_fields[]={
|
||||
"left",
|
||||
"ops",
|
||||
"comparators",
|
||||
};
|
||||
static PyTypeObject *Call_type;
|
||||
_Py_identifier(func);
|
||||
_Py_IDENTIFIER(func);
|
||||
static char *Call_fields[]={
|
||||
"func",
|
||||
"args",
|
||||
|
@ -252,12 +252,12 @@ static char *Call_fields[]={
|
|||
"kwargs",
|
||||
};
|
||||
static PyTypeObject *Num_type;
|
||||
_Py_identifier(n);
|
||||
_Py_IDENTIFIER(n);
|
||||
static char *Num_fields[]={
|
||||
"n",
|
||||
};
|
||||
static PyTypeObject *Str_type;
|
||||
_Py_identifier(s);
|
||||
_Py_IDENTIFIER(s);
|
||||
static char *Str_fields[]={
|
||||
"s",
|
||||
};
|
||||
|
@ -267,15 +267,15 @@ static char *Bytes_fields[]={
|
|||
};
|
||||
static PyTypeObject *Ellipsis_type;
|
||||
static PyTypeObject *Attribute_type;
|
||||
_Py_identifier(attr);
|
||||
_Py_identifier(ctx);
|
||||
_Py_IDENTIFIER(attr);
|
||||
_Py_IDENTIFIER(ctx);
|
||||
static char *Attribute_fields[]={
|
||||
"value",
|
||||
"attr",
|
||||
"ctx",
|
||||
};
|
||||
static PyTypeObject *Subscript_type;
|
||||
_Py_identifier(slice);
|
||||
_Py_IDENTIFIER(slice);
|
||||
static char *Subscript_fields[]={
|
||||
"value",
|
||||
"slice",
|
||||
|
@ -287,7 +287,7 @@ static char *Starred_fields[]={
|
|||
"ctx",
|
||||
};
|
||||
static PyTypeObject *Name_type;
|
||||
_Py_identifier(id);
|
||||
_Py_IDENTIFIER(id);
|
||||
static char *Name_fields[]={
|
||||
"id",
|
||||
"ctx",
|
||||
|
@ -315,16 +315,16 @@ static PyTypeObject *Param_type;
|
|||
static PyTypeObject *slice_type;
|
||||
static PyObject* ast2obj_slice(void*);
|
||||
static PyTypeObject *Slice_type;
|
||||
_Py_identifier(lower);
|
||||
_Py_identifier(upper);
|
||||
_Py_identifier(step);
|
||||
_Py_IDENTIFIER(lower);
|
||||
_Py_IDENTIFIER(upper);
|
||||
_Py_IDENTIFIER(step);
|
||||
static char *Slice_fields[]={
|
||||
"lower",
|
||||
"upper",
|
||||
"step",
|
||||
};
|
||||
static PyTypeObject *ExtSlice_type;
|
||||
_Py_identifier(dims);
|
||||
_Py_IDENTIFIER(dims);
|
||||
static char *ExtSlice_fields[]={
|
||||
"dims",
|
||||
};
|
||||
|
@ -380,7 +380,7 @@ static PyTypeObject *In_type;
|
|||
static PyTypeObject *NotIn_type;
|
||||
static PyTypeObject *comprehension_type;
|
||||
static PyObject* ast2obj_comprehension(void*);
|
||||
_Py_identifier(ifs);
|
||||
_Py_IDENTIFIER(ifs);
|
||||
static char *comprehension_fields[]={
|
||||
"target",
|
||||
"iter",
|
||||
|
@ -393,7 +393,7 @@ static char *excepthandler_attributes[] = {
|
|||
};
|
||||
static PyObject* ast2obj_excepthandler(void*);
|
||||
static PyTypeObject *ExceptHandler_type;
|
||||
_Py_identifier(type);
|
||||
_Py_IDENTIFIER(type);
|
||||
static char *ExceptHandler_fields[]={
|
||||
"type",
|
||||
"name",
|
||||
|
@ -401,13 +401,13 @@ static char *ExceptHandler_fields[]={
|
|||
};
|
||||
static PyTypeObject *arguments_type;
|
||||
static PyObject* ast2obj_arguments(void*);
|
||||
_Py_identifier(vararg);
|
||||
_Py_identifier(varargannotation);
|
||||
_Py_identifier(kwonlyargs);
|
||||
_Py_identifier(kwarg);
|
||||
_Py_identifier(kwargannotation);
|
||||
_Py_identifier(defaults);
|
||||
_Py_identifier(kw_defaults);
|
||||
_Py_IDENTIFIER(vararg);
|
||||
_Py_IDENTIFIER(varargannotation);
|
||||
_Py_IDENTIFIER(kwonlyargs);
|
||||
_Py_IDENTIFIER(kwarg);
|
||||
_Py_IDENTIFIER(kwargannotation);
|
||||
_Py_IDENTIFIER(defaults);
|
||||
_Py_IDENTIFIER(kw_defaults);
|
||||
static char *arguments_fields[]={
|
||||
"args",
|
||||
"vararg",
|
||||
|
@ -420,8 +420,8 @@ static char *arguments_fields[]={
|
|||
};
|
||||
static PyTypeObject *arg_type;
|
||||
static PyObject* ast2obj_arg(void*);
|
||||
_Py_identifier(arg);
|
||||
_Py_identifier(annotation);
|
||||
_Py_IDENTIFIER(arg);
|
||||
_Py_IDENTIFIER(annotation);
|
||||
static char *arg_fields[]={
|
||||
"arg",
|
||||
"annotation",
|
||||
|
@ -434,15 +434,15 @@ static char *keyword_fields[]={
|
|||
};
|
||||
static PyTypeObject *alias_type;
|
||||
static PyObject* ast2obj_alias(void*);
|
||||
_Py_identifier(asname);
|
||||
_Py_IDENTIFIER(asname);
|
||||
static char *alias_fields[]={
|
||||
"name",
|
||||
"asname",
|
||||
};
|
||||
static PyTypeObject *withitem_type;
|
||||
static PyObject* ast2obj_withitem(void*);
|
||||
_Py_identifier(context_expr);
|
||||
_Py_identifier(optional_vars);
|
||||
_Py_IDENTIFIER(context_expr);
|
||||
_Py_IDENTIFIER(optional_vars);
|
||||
static char *withitem_fields[]={
|
||||
"context_expr",
|
||||
"optional_vars",
|
||||
|
@ -452,7 +452,7 @@ static char *withitem_fields[]={
|
|||
static int
|
||||
ast_type_init(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
_Py_identifier(_fields);
|
||||
_Py_IDENTIFIER(_fields);
|
||||
Py_ssize_t i, numfields = 0;
|
||||
int res = -1;
|
||||
PyObject *key, *value, *fields;
|
||||
|
@ -506,7 +506,7 @@ static PyObject *
|
|||
ast_type_reduce(PyObject *self, PyObject *unused)
|
||||
{
|
||||
PyObject *res;
|
||||
_Py_identifier(__dict__);
|
||||
_Py_IDENTIFIER(__dict__);
|
||||
PyObject *dict = _PyObject_GetAttrId(self, &PyId___dict__);
|
||||
if (dict == NULL) {
|
||||
if (PyErr_ExceptionMatches(PyExc_AttributeError))
|
||||
|
|
|
@ -18,7 +18,7 @@ static int
|
|||
check_matched(PyObject *obj, PyObject *arg)
|
||||
{
|
||||
PyObject *result;
|
||||
_Py_identifier(match);
|
||||
_Py_IDENTIFIER(match);
|
||||
int rc;
|
||||
|
||||
if (obj == Py_None)
|
||||
|
@ -247,7 +247,7 @@ show_warning(PyObject *filename, int lineno, PyObject *text, PyObject
|
|||
PyObject *f_stderr;
|
||||
PyObject *name;
|
||||
char lineno_str[128];
|
||||
_Py_identifier(__name__);
|
||||
_Py_IDENTIFIER(__name__);
|
||||
|
||||
PyOS_snprintf(lineno_str, sizeof(lineno_str), ":%d: ", lineno);
|
||||
|
||||
|
|
|
@ -527,7 +527,7 @@ static PyObject *parsestrplus(struct compiling *, const node *n,
|
|||
static identifier
|
||||
new_identifier(const char* n, PyArena *arena)
|
||||
{
|
||||
_Py_identifier(normalize);
|
||||
_Py_IDENTIFIER(normalize);
|
||||
PyObject* id = PyUnicode_DecodeUTF8(n, strlen(n), NULL);
|
||||
if (!id || PyUnicode_READY(id) == -1)
|
||||
return NULL;
|
||||
|
|
|
@ -32,8 +32,8 @@ const char *Py_FileSystemDefaultEncoding = NULL; /* set by initfsencoding() */
|
|||
int Py_HasFileSystemDefaultEncoding = 0;
|
||||
#endif
|
||||
|
||||
_Py_identifier(fileno);
|
||||
_Py_identifier(flush);
|
||||
_Py_IDENTIFIER(fileno);
|
||||
_Py_IDENTIFIER(flush);
|
||||
|
||||
static PyObject *
|
||||
builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds)
|
||||
|
@ -41,7 +41,7 @@ builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds)
|
|||
PyObject *func, *name, *bases, *mkw, *meta, *prep, *ns, *cell;
|
||||
PyObject *cls = NULL;
|
||||
Py_ssize_t nargs;
|
||||
_Py_identifier(__prepare__);
|
||||
_Py_IDENTIFIER(__prepare__);
|
||||
|
||||
assert(args != NULL);
|
||||
if (!PyTuple_Check(args)) {
|
||||
|
@ -1614,7 +1614,7 @@ builtin_input(PyObject *self, PyObject *args)
|
|||
char *stdin_encoding_str;
|
||||
PyObject *result;
|
||||
size_t len;
|
||||
_Py_identifier(encoding);
|
||||
_Py_IDENTIFIER(encoding);
|
||||
|
||||
stdin_encoding = _PyObject_GetAttrId(fin, &PyId_encoding);
|
||||
if (!stdin_encoding)
|
||||
|
@ -1790,7 +1790,7 @@ builtin_sorted(PyObject *self, PyObject *args, PyObject *kwds)
|
|||
PyObject *callable;
|
||||
static char *kwlist[] = {"iterable", "key", "reverse", 0};
|
||||
int reverse;
|
||||
_Py_identifier(sort);
|
||||
_Py_IDENTIFIER(sort);
|
||||
|
||||
/* args 1-3 should match listsort in Objects/listobject.c */
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|Oi:sorted",
|
||||
|
@ -1847,7 +1847,7 @@ builtin_vars(PyObject *self, PyObject *args)
|
|||
Py_INCREF(d);
|
||||
}
|
||||
else {
|
||||
_Py_identifier(__dict__);
|
||||
_Py_IDENTIFIER(__dict__);
|
||||
d = _PyObject_GetAttrId(v, &PyId___dict__);
|
||||
if (d == NULL) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
|
|
|
@ -372,7 +372,7 @@ PyEval_ReleaseThread(PyThreadState *tstate)
|
|||
void
|
||||
PyEval_ReInitThreads(void)
|
||||
{
|
||||
_Py_identifier(_after_fork);
|
||||
_Py_IDENTIFIER(_after_fork);
|
||||
PyObject *threading, *result;
|
||||
PyThreadState *tstate = PyThreadState_GET();
|
||||
|
||||
|
|
|
@ -467,8 +467,8 @@ PyObject *PyCodec_LookupError(const char *name)
|
|||
|
||||
static void wrong_exception_type(PyObject *exc)
|
||||
{
|
||||
_Py_identifier(__class__);
|
||||
_Py_identifier(__name__);
|
||||
_Py_IDENTIFIER(__class__);
|
||||
_Py_IDENTIFIER(__name__);
|
||||
PyObject *type = _PyObject_GetAttrId(exc, &PyId___class__);
|
||||
if (type != NULL) {
|
||||
PyObject *name = _PyObject_GetAttrId(type, &PyId___name__);
|
||||
|
|
|
@ -712,7 +712,7 @@ PyErr_NewExceptionWithDoc(const char *name, const char *doc,
|
|||
void
|
||||
PyErr_WriteUnraisable(PyObject *obj)
|
||||
{
|
||||
_Py_identifier(__module__);
|
||||
_Py_IDENTIFIER(__module__);
|
||||
PyObject *f, *t, *v, *tb;
|
||||
PyErr_Fetch(&t, &v, &tb);
|
||||
f = PySys_GetObject("stderr");
|
||||
|
|
|
@ -154,7 +154,7 @@ static const struct filedescr _PyImport_StandardFiletab[] = {
|
|||
};
|
||||
|
||||
static PyObject *initstr = NULL;
|
||||
_Py_identifier(__path__);
|
||||
_Py_IDENTIFIER(__path__);
|
||||
|
||||
/* Initialize things */
|
||||
|
||||
|
@ -248,7 +248,7 @@ _PyImportHooks_Init(void)
|
|||
PySys_WriteStderr("# can't import zipimport\n");
|
||||
}
|
||||
else {
|
||||
_Py_identifier(zipimporter);
|
||||
_Py_IDENTIFIER(zipimporter);
|
||||
PyObject *zipimporter = _PyObject_GetAttrId(zimpimport,
|
||||
&PyId_zipimporter);
|
||||
Py_DECREF(zimpimport);
|
||||
|
@ -1802,7 +1802,7 @@ find_module_path(PyObject *fullname, PyObject *name, PyObject *path,
|
|||
|
||||
/* sys.path_hooks import hook */
|
||||
if (p_loader != NULL) {
|
||||
_Py_identifier(find_module);
|
||||
_Py_IDENTIFIER(find_module);
|
||||
PyObject *importer;
|
||||
|
||||
importer = get_path_importer(path_importer_cache,
|
||||
|
@ -2032,7 +2032,7 @@ find_module(PyObject *fullname, PyObject *name, PyObject *search_path_list,
|
|||
|
||||
/* sys.meta_path import hook */
|
||||
if (p_loader != NULL) {
|
||||
_Py_identifier(find_module);
|
||||
_Py_IDENTIFIER(find_module);
|
||||
PyObject *meta_path;
|
||||
|
||||
meta_path = PySys_GetObject("meta_path");
|
||||
|
@ -2462,7 +2462,7 @@ load_module(PyObject *name, FILE *fp, PyObject *pathname, int type, PyObject *lo
|
|||
break;
|
||||
|
||||
case IMP_HOOK: {
|
||||
_Py_identifier(load_module);
|
||||
_Py_IDENTIFIER(load_module);
|
||||
if (loader == NULL) {
|
||||
PyErr_SetString(PyExc_ImportError,
|
||||
"import hook without loader");
|
||||
|
@ -3227,7 +3227,7 @@ ensure_fromlist(PyObject *mod, PyObject *fromlist, PyObject *name,
|
|||
}
|
||||
if (PyUnicode_READ_CHAR(item, 0) == '*') {
|
||||
PyObject *all;
|
||||
_Py_identifier(__all__);
|
||||
_Py_IDENTIFIER(__all__);
|
||||
Py_DECREF(item);
|
||||
/* See if the package defines __all__ */
|
||||
if (recursive)
|
||||
|
|
|
@ -480,7 +480,7 @@ r_string(char *s, int n, RFILE *p)
|
|||
}
|
||||
}
|
||||
else {
|
||||
_Py_identifier(read);
|
||||
_Py_IDENTIFIER(read);
|
||||
|
||||
PyObject *data = _PyObject_CallMethodId(p->readable, &PyId_read, "i", n);
|
||||
read = 0;
|
||||
|
@ -1292,7 +1292,7 @@ marshal_dump(PyObject *self, PyObject *args)
|
|||
int version = Py_MARSHAL_VERSION;
|
||||
PyObject *s;
|
||||
PyObject *res;
|
||||
_Py_identifier(write);
|
||||
_Py_IDENTIFIER(write);
|
||||
|
||||
if (!PyArg_ParseTuple(args, "OO|i:dump", &x, &f, &version))
|
||||
return NULL;
|
||||
|
@ -1321,7 +1321,7 @@ static PyObject *
|
|||
marshal_load(PyObject *self, PyObject *f)
|
||||
{
|
||||
PyObject *data, *result;
|
||||
_Py_identifier(read);
|
||||
_Py_IDENTIFIER(read);
|
||||
RFILE rf;
|
||||
|
||||
/*
|
||||
|
|
|
@ -141,7 +141,7 @@ get_codec_name(const char *encoding)
|
|||
{
|
||||
char *name_utf8, *name_str;
|
||||
PyObject *codec, *name = NULL;
|
||||
_Py_identifier(name);
|
||||
_Py_IDENTIFIER(name);
|
||||
|
||||
codec = _PyCodec_Lookup(encoding);
|
||||
if (!codec)
|
||||
|
@ -353,7 +353,7 @@ flush_std_files(void)
|
|||
PyObject *fout = PySys_GetObject("stdout");
|
||||
PyObject *ferr = PySys_GetObject("stderr");
|
||||
PyObject *tmp;
|
||||
_Py_identifier(flush);
|
||||
_Py_IDENTIFIER(flush);
|
||||
|
||||
if (fout != NULL && fout != Py_None) {
|
||||
tmp = _PyObject_CallMethodId(fout, &PyId_flush, "");
|
||||
|
@ -807,9 +807,9 @@ create_stdio(PyObject* io,
|
|||
const char* newline;
|
||||
PyObject *line_buffering;
|
||||
int buffering, isatty;
|
||||
_Py_identifier(open);
|
||||
_Py_identifier(isatty);
|
||||
_Py_identifier(TextIOWrapper);
|
||||
_Py_IDENTIFIER(open);
|
||||
_Py_IDENTIFIER(isatty);
|
||||
_Py_IDENTIFIER(TextIOWrapper);
|
||||
|
||||
/* stdin is always opened in buffered mode, first because it shouldn't
|
||||
make a difference in common use cases, second because TextIOWrapper
|
||||
|
@ -831,7 +831,7 @@ create_stdio(PyObject* io,
|
|||
goto error;
|
||||
|
||||
if (buffering) {
|
||||
_Py_identifier(raw);
|
||||
_Py_IDENTIFIER(raw);
|
||||
raw = _PyObject_GetAttrId(buf, &PyId_raw);
|
||||
if (raw == NULL)
|
||||
goto error;
|
||||
|
@ -1117,7 +1117,7 @@ PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags
|
|||
PyArena *arena;
|
||||
char *ps1 = "", *ps2 = "", *enc = NULL;
|
||||
int errcode = 0;
|
||||
_Py_identifier(encoding);
|
||||
_Py_IDENTIFIER(encoding);
|
||||
|
||||
if (fp == stdin) {
|
||||
/* Fetch encoding from sys.stdin */
|
||||
|
@ -1321,11 +1321,11 @@ parse_syntax_error(PyObject *err, PyObject **message, const char **filename,
|
|||
{
|
||||
long hold;
|
||||
PyObject *v;
|
||||
_Py_identifier(msg);
|
||||
_Py_identifier(filename);
|
||||
_Py_identifier(lineno);
|
||||
_Py_identifier(offset);
|
||||
_Py_identifier(text);
|
||||
_Py_IDENTIFIER(msg);
|
||||
_Py_IDENTIFIER(filename);
|
||||
_Py_IDENTIFIER(lineno);
|
||||
_Py_IDENTIFIER(offset);
|
||||
_Py_IDENTIFIER(text);
|
||||
|
||||
/* old style errors */
|
||||
if (PyTuple_Check(err))
|
||||
|
@ -1439,7 +1439,7 @@ handle_system_exit(void)
|
|||
goto done;
|
||||
if (PyExceptionInstance_Check(value)) {
|
||||
/* The error code should be in the `code' attribute. */
|
||||
_Py_identifier(code);
|
||||
_Py_IDENTIFIER(code);
|
||||
PyObject *code = _PyObject_GetAttrId(value, &PyId_code);
|
||||
if (code) {
|
||||
Py_DECREF(value);
|
||||
|
@ -1597,7 +1597,7 @@ print_exception(PyObject *f, PyObject *value)
|
|||
else {
|
||||
PyObject* moduleName;
|
||||
char* className;
|
||||
_Py_identifier(__module__);
|
||||
_Py_IDENTIFIER(__module__);
|
||||
assert(PyExceptionClass_Check(type));
|
||||
className = PyExceptionClass_Name(type);
|
||||
if (className != NULL) {
|
||||
|
@ -1773,7 +1773,7 @@ flush_io(void)
|
|||
{
|
||||
PyObject *f, *r;
|
||||
PyObject *type, *value, *traceback;
|
||||
_Py_identifier(flush);
|
||||
_Py_IDENTIFIER(flush);
|
||||
|
||||
/* Save the current exception */
|
||||
PyErr_Fetch(&type, &value, &traceback);
|
||||
|
@ -2220,7 +2220,7 @@ static void
|
|||
wait_for_thread_shutdown(void)
|
||||
{
|
||||
#ifdef WITH_THREAD
|
||||
_Py_identifier(_shutdown);
|
||||
_Py_IDENTIFIER(_shutdown);
|
||||
PyObject *result;
|
||||
PyThreadState *tstate = PyThreadState_GET();
|
||||
PyObject *threading = PyMapping_GetItemString(tstate->interp->modules,
|
||||
|
|
|
@ -79,8 +79,8 @@ sys_displayhook_unencodable(PyObject *outf, PyObject *o)
|
|||
PyObject *encoded, *escaped_str, *repr_str, *buffer, *result;
|
||||
char *stdout_encoding_str;
|
||||
int ret;
|
||||
_Py_identifier(encoding);
|
||||
_Py_identifier(buffer);
|
||||
_Py_IDENTIFIER(encoding);
|
||||
_Py_IDENTIFIER(buffer);
|
||||
|
||||
stdout_encoding = _PyObject_GetAttrId(outf, &PyId_encoding);
|
||||
if (stdout_encoding == NULL)
|
||||
|
@ -101,7 +101,7 @@ sys_displayhook_unencodable(PyObject *outf, PyObject *o)
|
|||
|
||||
buffer = _PyObject_GetAttrId(outf, &PyId_buffer);
|
||||
if (buffer) {
|
||||
_Py_identifier(write);
|
||||
_Py_IDENTIFIER(write);
|
||||
result = _PyObject_CallMethodId(buffer, &PyId_write, "(O)", encoded);
|
||||
Py_DECREF(buffer);
|
||||
Py_DECREF(encoded);
|
||||
|
@ -1843,7 +1843,7 @@ sys_pyfile_write_unicode(PyObject *unicode, PyObject *file)
|
|||
{
|
||||
PyObject *writer = NULL, *args = NULL, *result = NULL;
|
||||
int err;
|
||||
_Py_identifier(write);
|
||||
_Py_IDENTIFIER(write);
|
||||
|
||||
if (file == NULL)
|
||||
return -1;
|
||||
|
|
|
@ -152,7 +152,7 @@ _Py_FindSourceFile(PyObject *filename, char* namebuf, size_t namelen, PyObject *
|
|||
const char* filepath;
|
||||
Py_ssize_t len;
|
||||
PyObject* result;
|
||||
_Py_identifier(open);
|
||||
_Py_IDENTIFIER(open);
|
||||
|
||||
filebytes = PyUnicode_EncodeFSDefault(filename);
|
||||
if (filebytes == NULL) {
|
||||
|
@ -232,9 +232,9 @@ _Py_DisplaySourceLine(PyObject *f, PyObject *filename, int lineno, int indent)
|
|||
char buf[MAXPATHLEN+1];
|
||||
int kind;
|
||||
void *data;
|
||||
_Py_identifier(close);
|
||||
_Py_identifier(open);
|
||||
_Py_identifier(TextIOWrapper);
|
||||
_Py_IDENTIFIER(close);
|
||||
_Py_IDENTIFIER(open);
|
||||
_Py_IDENTIFIER(TextIOWrapper);
|
||||
|
||||
/* open the file */
|
||||
if (filename == NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue