summaryrefslogtreecommitdiff
path: root/Modules/bz2module.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/bz2module.c')
-rw-r--r--Modules/bz2module.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/Modules/bz2module.c b/Modules/bz2module.c
index f41896998d..3e55202bd8 100644
--- a/Modules/bz2module.c
+++ b/Modules/bz2module.c
@@ -1206,10 +1206,7 @@ BZ2File_init(BZ2FileObject *self, PyObject *args, PyObject *kwargs)
&compresslevel))
return -1;
- if (PyBytes_Check(name_obj))
- name = PyBytes_AsString(name_obj);
- else
- name = PyByteArray_AsString(name_obj);
+ name = PyBytes_AsString(name_obj);
if (compresslevel < 1 || compresslevel > 9) {
PyErr_SetString(PyExc_ValueError,
"compresslevel must be between 1 and 9");