Mercurial > cpython-lru_cache-weakref
comparison Python/_warnings.c @ 74510:c19b0ae5cd91
Finally fix all test_capi refleaks
| author | Antoine Pitrou <solipsis@pitrou.net> |
|---|---|
| date | Wed, 18 Jan 2012 21:45:15 +0100 |
| parents | c2153ce1b5dd |
| children | 8a5bebea9fec |
comparison
equal
deleted
inserted
replaced
| 74509:44d8aa3c1003 | 74510:c19b0ae5cd91 |
|---|---|
| 956 | 956 |
| 957 m = PyModule_Create(&warningsmodule); | 957 m = PyModule_Create(&warningsmodule); |
| 958 if (m == NULL) | 958 if (m == NULL) |
| 959 return NULL; | 959 return NULL; |
| 960 | 960 |
| 961 _filters = init_filters(); | 961 if (_filters == NULL) { |
| 962 if (_filters == NULL) | 962 _filters = init_filters(); |
| 963 return NULL; | 963 if (_filters == NULL) |
| 964 return NULL; | |
| 965 } | |
| 964 Py_INCREF(_filters); | 966 Py_INCREF(_filters); |
| 965 if (PyModule_AddObject(m, "filters", _filters) < 0) | 967 if (PyModule_AddObject(m, "filters", _filters) < 0) |
| 966 return NULL; | 968 return NULL; |
| 967 | 969 |
| 968 _once_registry = PyDict_New(); | 970 if (_once_registry == NULL) { |
| 969 if (_once_registry == NULL) | 971 _once_registry = PyDict_New(); |
| 970 return NULL; | 972 if (_once_registry == NULL) |
| 973 return NULL; | |
| 974 } | |
| 971 Py_INCREF(_once_registry); | 975 Py_INCREF(_once_registry); |
| 972 if (PyModule_AddObject(m, "_onceregistry", _once_registry) < 0) | 976 if (PyModule_AddObject(m, "_onceregistry", _once_registry) < 0) |
| 973 return NULL; | 977 return NULL; |
| 974 | 978 |
| 975 _default_action = PyUnicode_FromString("default"); | 979 if (_default_action == NULL) { |
| 976 if (_default_action == NULL) | 980 _default_action = PyUnicode_FromString("default"); |
| 977 return NULL; | 981 if (_default_action == NULL) |
| 982 return NULL; | |
| 983 } | |
| 984 Py_INCREF(_default_action); | |
| 978 if (PyModule_AddObject(m, "_defaultaction", _default_action) < 0) | 985 if (PyModule_AddObject(m, "_defaultaction", _default_action) < 0) |
| 979 return NULL; | 986 return NULL; |
| 980 return m; | 987 return m; |
| 981 } | 988 } |
