summaryrefslogtreecommitdiffstats
path: root/Objects/exceptions.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r--Objects/exceptions.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 977dce5..9dbbd40 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -15,10 +15,10 @@
/* Compatibility aliases */
-PyObject *PyExc_EnvironmentError = NULL;
-PyObject *PyExc_IOError = NULL;
+PyObject *PyExc_EnvironmentError = NULL; // borrowed ref
+PyObject *PyExc_IOError = NULL; // borrowed ref
#ifdef MS_WINDOWS
-PyObject *PyExc_WindowsError = NULL;
+PyObject *PyExc_WindowsError = NULL; // borrowed ref
#endif
@@ -3647,10 +3647,8 @@ _PyBuiltins_AddExceptions(PyObject *bltinmod)
#define INIT_ALIAS(NAME, TYPE) \
do { \
- Py_INCREF(PyExc_ ## TYPE); \
- Py_XDECREF(PyExc_ ## NAME); \
PyExc_ ## NAME = PyExc_ ## TYPE; \
- if (PyDict_SetItemString(mod_dict, # NAME, PyExc_ ## NAME)) { \
+ if (PyDict_SetItemString(mod_dict, # NAME, PyExc_ ## TYPE)) { \
return -1; \
} \
} while (0)