Skip to content

Commit 8309962

Browse files
committed
Replaced ImagingError_OSError with PyErr_SetString
1 parent cb433ad commit 8309962

File tree

3 files changed

+1
-9
lines changed

3 files changed

+1
-9
lines changed

src/_imaging.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,6 @@ static const char *no_palette = "image has no palette";
338338
static const char *readonly = "image is readonly";
339339
/* static const char* no_content = "image has no content"; */
340340

341-
void *
342-
ImagingError_OSError(void) {
343-
PyErr_SetString(PyExc_OSError, "error when accessing file");
344-
return NULL;
345-
}
346-
347341
void *
348342
ImagingError_MemoryError(void) {
349343
return PyErr_NoMemory();

src/libImaging/File.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ ImagingSavePPM(Imaging im, const char *outfile) {
5454

5555
fp = fopen(outfile, "wb");
5656
if (!fp) {
57-
(void)ImagingError_OSError();
57+
PyErr_SetString(PyExc_OSError, "error when accessing file");
5858
return 0;
5959
}
6060

src/libImaging/Imaging.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,6 @@ ImagingSectionLeave(ImagingSectionCookie *cookie);
270270
/* Exceptions */
271271
/* ---------- */
272272

273-
extern void *
274-
ImagingError_OSError(void);
275273
extern void *
276274
ImagingError_MemoryError(void);
277275
extern void *

0 commit comments

Comments
 (0)