summaryrefslogtreecommitdiffstats
path: root/Modules/_bz2module.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_bz2module.c')
-rw-r--r--Modules/_bz2module.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_bz2module.c b/Modules/_bz2module.c
index 5cea42c..409522f 100644
--- a/Modules/_bz2module.c
+++ b/Modules/_bz2module.c
@@ -96,10 +96,10 @@ catch_bz2_error(int bzerror)
return 1;
case BZ_DATA_ERROR:
case BZ_DATA_ERROR_MAGIC:
- PyErr_SetString(PyExc_IOError, "Invalid data stream");
+ PyErr_SetString(PyExc_OSError, "Invalid data stream");
return 1;
case BZ_IO_ERROR:
- PyErr_SetString(PyExc_IOError, "Unknown I/O error");
+ PyErr_SetString(PyExc_OSError, "Unknown I/O error");
return 1;
case BZ_UNEXPECTED_EOF:
PyErr_SetString(PyExc_EOFError,
@@ -112,7 +112,7 @@ catch_bz2_error(int bzerror)
"Invalid sequence of commands sent to libbzip2");
return 1;
default:
- PyErr_Format(PyExc_IOError,
+ PyErr_Format(PyExc_OSError,
"Unrecognized error from libbzip2: %d", bzerror);
return 1;
}