Mercurial > cpython-lru_cache-weakref
comparison Python/errors.c @ 72879:41a1de81ef2b
PEP 3151 / issue #12555: reworking the OS and IO exception hierarchy.
| author | Antoine Pitrou <solipsis@pitrou.net> |
|---|---|
| date | Wed, 12 Oct 2011 02:54:14 +0200 |
| parents | 81380082d216 |
| children | 793c75177d28 |
comparison
equal
deleted
inserted
replaced
| 72878:2abd48a47f3b | 72879:41a1de81ef2b |
|---|---|
| 494 { | 494 { |
| 495 LocalFree(s_buf); | 495 LocalFree(s_buf); |
| 496 return NULL; | 496 return NULL; |
| 497 } | 497 } |
| 498 | 498 |
| 499 if (filenameObject != NULL) | 499 if (filenameObject == NULL) |
| 500 v = Py_BuildValue("(iOO)", err, message, filenameObject); | 500 filenameObject = Py_None; |
| 501 else | 501 /* This is the constructor signature for passing a Windows error code. |
| 502 v = Py_BuildValue("(iO)", err, message); | 502 The POSIX translation will be figured out by the constructor. */ |
| 503 v = Py_BuildValue("(iOOi)", 0, message, filenameObject, err); | |
| 503 Py_DECREF(message); | 504 Py_DECREF(message); |
| 504 | 505 |
| 505 if (v != NULL) { | 506 if (v != NULL) { |
| 506 PyErr_SetObject(exc, v); | 507 PyErr_SetObject(exc, v); |
| 507 Py_DECREF(v); | 508 Py_DECREF(v); |
