Lines Matching defs:modules
203 modules. On platforms without threads, this function does nothing.
267 if (interp->modules == NULL) {
268 Py_FatalError("interpreter has no modules dictionary");
270 return interp->modules;
280 if (interp->modules == NULL)
299 PyObject *modules = interp->modules;
300 return PyObject_SetItem(modules, name, m);
307 PyObject *modules = interp->modules;
308 return PyMapping_SetItemString(modules, name, m);
314 PyObject *modules = tstate->interp->modules;
315 if (modules == NULL) {
317 "unable to get sys.modules");
322 Py_INCREF(modules);
323 if (PyDict_CheckExact(modules)) {
324 m = PyDict_GetItemWithError(modules, name); /* borrowed */
328 m = PyObject_GetItem(modules, name);
333 Py_DECREF(modules);
346 stuffing the new module in sys.modules.
395 /* Magic for extension modules (built-in as well as dynamically
398 (module name, module name) (for built-in modules) or by
399 (filename, module name) (for dynamically loaded modules), containing these
400 modules. A copy of the module's dictionary is stored by calling
413 PyObject *filename, PyObject *modules)
427 if (PyObject_SetItem(modules, name, mod) < 0) {
431 PyMapping_DelItem(modules, name);
477 _PyImport_FixupBuiltin(PyObject *mod, const char *name, PyObject *modules)
484 res = _PyImport_FixupExtensionObject(mod, nameobj, nameobj, modules);
508 PyObject *modules = tstate->interp->modules;
533 if (PyObject_SetItem(modules, name, mod) == -1) {
539 PyMapping_DelItem(modules, name);
554 First check the modules dictionary if there's one there,
555 if not, create a new one and insert it in the modules dictionary. */
560 PyObject *modules = tstate->interp->modules;
561 if (modules == NULL) {
568 if (PyDict_CheckExact(modules)) {
569 m = PyDict_GetItemWithError(modules, name);
573 m = PyObject_GetItem(modules, name);
590 if (PyObject_SetItem(modules, name, m) != 0) {
629 /* Remove name from sys.modules, if it's there.
640 PyObject *modules = tstate->interp->modules;
641 if (PyDict_CheckExact(modules)) {
642 PyObject *mod = _PyDict_Pop(modules, name, Py_None);
645 else if (PyMapping_DelItem(modules, name) < 0) {
657 * removed from sys.modules, to avoid leaving damaged module objects
658 * in sys.modules. The caller may wish to restore the original
774 "Loaded module %R not found in sys.modules",
976 PyObject *modules = tstate->interp->modules;
1001 modules) < 0) {
1064 /* Frozen modules */
1103 // We always use the bootstrap modules.
1110 // Frozen stdlib modules may be disabled.
1128 // Add any custom modules.
1183 err = "Frozen modules are disabled and the frozen object named %R is not essential";
1211 // We always use the bootstrap modules.
1221 // Prefer custom modules, if any. Frozen stdlib modules can be
1233 // Frozen stdlib modules may be disabled.
1461 * At first it tries to fetch the module from sys.modules. If the module was
1887 "%R not in sys.modules as expected",
2047 Returns the list of file suffixes used to identify extension modules.
2281 Returns the list of available frozen modules.
2571 to the table of built-in modules. This should normally be called