Mercurial > cpython-lru_cache-weakref
comparison Python/errors.c @ 40955:2ce229a7ba3f 2.5
Fix SF bug #1669182. Handle string exceptions even if unraisable (ie in __del__).
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Mon, 26 Feb 2007 23:46:51 +0000 |
| parents | ca295c270b1c |
| children | 787b969d37f0 |
comparison
equal
deleted
inserted
replaced
| 40952:430811bdbfef | 40955:2ce229a7ba3f |
|---|---|
| 588 f = PySys_GetObject("stderr"); | 588 f = PySys_GetObject("stderr"); |
| 589 if (f != NULL) { | 589 if (f != NULL) { |
| 590 PyFile_WriteString("Exception ", f); | 590 PyFile_WriteString("Exception ", f); |
| 591 if (t) { | 591 if (t) { |
| 592 PyObject* moduleName; | 592 PyObject* moduleName; |
| 593 char* className = PyExceptionClass_Name(t); | 593 char* className = NULL; |
| 594 if (PyExceptionClass_Check(t)) | |
| 595 className = PyExceptionClass_Name(t); | |
| 596 else if (PyString_Check(t)) | |
| 597 className = PyString_AS_STRING(t); | |
| 594 | 598 |
| 595 if (className != NULL) { | 599 if (className != NULL) { |
| 596 char *dot = strrchr(className, '.'); | 600 char *dot = strrchr(className, '.'); |
| 597 if (dot != NULL) | 601 if (dot != NULL) |
| 598 className = dot+1; | 602 className = dot+1; |
