Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 29879:ed8709b1a3ef legacy-trunk
Correct previous patch looking for warnings module: sys.modules, not
sys.__modules__.
| author | Mark Hammond <mhammond@skippinet.com.au> |
|---|---|
| date | Wed, 16 Jul 2003 01:54:38 +0000 |
| parents | 72cbc41ccc2f |
| children | a88e6dfbfd6d |
comparison
equal
deleted
inserted
replaced
| 29878:2c5194baa994 | 29879:ed8709b1a3ef |
|---|---|
| 90 correctly, then does an implicit import of warnings for us | 90 correctly, then does an implicit import of warnings for us |
| 91 */ | 91 */ |
| 92 /* Save and restore any exceptions */ | 92 /* Save and restore any exceptions */ |
| 93 PyErr_Fetch(&typ, &val, &tb); | 93 PyErr_Fetch(&typ, &val, &tb); |
| 94 | 94 |
| 95 all_modules = PySys_GetObject("__modules__"); | 95 all_modules = PySys_GetObject("modules"); |
| 96 if (all_modules) { | 96 if (all_modules) { |
| 97 warnings_module = PyDict_GetItemString(all_modules, "warnings"); | 97 warnings_module = PyDict_GetItemString(all_modules, "warnings"); |
| 98 /* We keep a ref in the global */ | 98 /* We keep a ref in the global */ |
| 99 Py_XINCREF(warnings_module); | 99 Py_XINCREF(warnings_module); |
| 100 } | 100 } |
