(errcode: c_int)
| 3479 | } |
| 3480 | |
| 3481 | fn name_from_errcode(errcode: c_int) -> &'static str { |
| 3482 | for (name, code) in ERROR_CODES { |
| 3483 | if *code == errcode { |
| 3484 | return name; |
| 3485 | } |
| 3486 | } |
| 3487 | "unknown error code" |
| 3488 | } |
| 3489 | |
| 3490 | fn raise_exception( |
| 3491 | typ: PyTypeRef, |