summaryrefslogtreecommitdiffstats
path: root/Modules/_bz2module.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-04-16 07:46:38 (GMT)
committerGitHub <noreply@github.com>2017-04-16 07:46:38 (GMT)
commit55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0 (patch)
treec1b3aacf87240d393666321d49a5abde3e1d601f /Modules/_bz2module.c
parentfdbd01151dbd5feea3e4c0316d102db3d2a2a412 (diff)
downloadcpython-55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0.zip
cpython-55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0.tar.gz
cpython-55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0.tar.bz2
bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051)
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;
}