Replaced ImagingError_OSError with PyErr_SetString

This commit is contained in:
Andrew Murray 2025-06-16 08:19:27 +10:00
parent cb433ad00a
commit 8309962926
3 changed files with 1 additions and 9 deletions

View File

@ -338,12 +338,6 @@ static const char *no_palette = "image has no palette";
static const char *readonly = "image is readonly"; static const char *readonly = "image is readonly";
/* static const char* no_content = "image has no content"; */ /* static const char* no_content = "image has no content"; */
void *
ImagingError_OSError(void) {
PyErr_SetString(PyExc_OSError, "error when accessing file");
return NULL;
}
void * void *
ImagingError_MemoryError(void) { ImagingError_MemoryError(void) {
return PyErr_NoMemory(); return PyErr_NoMemory();

View File

@ -54,7 +54,7 @@ ImagingSavePPM(Imaging im, const char *outfile) {
fp = fopen(outfile, "wb"); fp = fopen(outfile, "wb");
if (!fp) { if (!fp) {
(void)ImagingError_OSError(); PyErr_SetString(PyExc_OSError, "error when accessing file");
return 0; return 0;
} }

View File

@ -270,8 +270,6 @@ ImagingSectionLeave(ImagingSectionCookie *cookie);
/* Exceptions */ /* Exceptions */
/* ---------- */ /* ---------- */
extern void *
ImagingError_OSError(void);
extern void * extern void *
ImagingError_MemoryError(void); ImagingError_MemoryError(void);
extern void * extern void *