mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
#1535: rename __builtin__ module to builtins.
This commit is contained in:
parent
87f9c53937
commit
1a3284ed69
70 changed files with 246 additions and 247 deletions
|
|
@ -1849,7 +1849,7 @@ _PyExc_Init(void)
|
|||
PRE_INIT(UnicodeWarning)
|
||||
PRE_INIT(BytesWarning)
|
||||
|
||||
bltinmod = PyImport_ImportModule("__builtin__");
|
||||
bltinmod = PyImport_ImportModule("builtins");
|
||||
if (bltinmod == NULL)
|
||||
Py_FatalError("exceptions bootstrapping error.");
|
||||
bdict = PyModule_GetDict(bltinmod);
|
||||
|
|
|
|||
|
|
@ -1961,7 +1961,7 @@ is_default_cmp(PyObject *cmpfunc)
|
|||
module = PyUnicode_AsString(f->m_module);
|
||||
if (module == NULL)
|
||||
return 0;
|
||||
if (strcmp(module, "__builtin__") != 0)
|
||||
if (strcmp(module, "builtins") != 0)
|
||||
return 0;
|
||||
if (strcmp(f->m_ml->ml_name, "cmp") != 0)
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ type_module(PyTypeObject *type, void *context)
|
|||
if (s != NULL)
|
||||
return PyUnicode_FromStringAndSize(
|
||||
type->tp_name, (Py_ssize_t)(s - type->tp_name));
|
||||
return PyUnicode_FromString("__builtin__");
|
||||
return PyUnicode_FromString("builtins");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -397,7 +397,7 @@ type_repr(PyTypeObject *type)
|
|||
else
|
||||
kind = "type";
|
||||
|
||||
if (mod != NULL && PyUnicode_CompareWithASCIIString(mod, "__builtin__"))
|
||||
if (mod != NULL && PyUnicode_CompareWithASCIIString(mod, "builtins"))
|
||||
rtn = PyUnicode_FromFormat("<%s '%U.%U'>", kind, mod, name);
|
||||
else
|
||||
rtn = PyUnicode_FromFormat("<%s '%s'>", kind, type->tp_name);
|
||||
|
|
@ -2455,7 +2455,7 @@ object_repr(PyObject *self)
|
|||
name = type_name(type, NULL);
|
||||
if (name == NULL)
|
||||
return NULL;
|
||||
if (mod != NULL && PyUnicode_CompareWithASCIIString(mod, "__builtin__"))
|
||||
if (mod != NULL && PyUnicode_CompareWithASCIIString(mod, "builtins"))
|
||||
rtn = PyUnicode_FromFormat("<%U.%U object at %p>", mod, name, self);
|
||||
else
|
||||
rtn = PyUnicode_FromFormat("<%s object at %p>",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue