diff -r fe189b8bd3ab Objects/exceptions.c --- a/Objects/exceptions.c Fri Aug 05 01:51:39 2016 +0000 +++ b/Objects/exceptions.c Fri Aug 05 17:55:37 2016 +0800 @@ -230,7 +230,7 @@ return -1; } - Py_XINCREF(tb); + Py_INCREF(tb); Py_XSETREF(self->traceback, tb); return 0; } @@ -985,7 +985,7 @@ return 0; error: - Py_XDECREF(args); + Py_DECREF(args); return -1; } @@ -1065,8 +1065,7 @@ } if (self->myerrno && self->strerror) return PyUnicode_FromFormat("[Errno %S] %S", - self->myerrno ? self->myerrno: Py_None, - self->strerror ? self->strerror: Py_None); + self->myerrno, self->strerror); return BaseException_str((PyBaseExceptionObject *)self); }