Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 10024:caf2c65a6bcf legacy-trunk
initmain(): Nailed a memory leak. bimod must be DECREF'd!
| author | Barry Warsaw <barry@python.org> |
|---|---|
| date | Fri, 29 Jan 1999 21:30:22 +0000 |
| parents | c1091e82e5aa |
| children | a4a268b725b2 |
comparison
equal
deleted
inserted
replaced
| 10023:89dcea63c46b | 10024:caf2c65a6bcf |
|---|---|
| 409 if (PyDict_GetItemString(d, "__builtins__") == NULL) { | 409 if (PyDict_GetItemString(d, "__builtins__") == NULL) { |
| 410 PyObject *bimod = PyImport_ImportModule("__builtin__"); | 410 PyObject *bimod = PyImport_ImportModule("__builtin__"); |
| 411 if (bimod == NULL || | 411 if (bimod == NULL || |
| 412 PyDict_SetItemString(d, "__builtins__", bimod) != 0) | 412 PyDict_SetItemString(d, "__builtins__", bimod) != 0) |
| 413 Py_FatalError("can't add __builtins__ to __main__"); | 413 Py_FatalError("can't add __builtins__ to __main__"); |
| 414 Py_DECREF(bimod); | |
| 414 } | 415 } |
| 415 } | 416 } |
| 416 | 417 |
| 417 /* Import the site module (not into __main__ though) */ | 418 /* Import the site module (not into __main__ though) */ |
| 418 | 419 |
