summaryrefslogtreecommitdiff
path: root/Lib/sunau.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-03-20 16:46:19 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2015-03-20 16:46:19 +0200
commit74a49ac3f5ac3c7a09c691db4888c981a0cb3232 (patch)
treefda01f4cbce74bb51529a4d05d0b954988607932 /Lib/sunau.py
parentd83b7c2df4439b678bf7e372f8c9bbaff2907689 (diff)
downloadcpython-git-74a49ac3f5ac3c7a09c691db4888c981a0cb3232.tar.gz
Issue #23681: Fixed Python 2 to 3 poring bugs.
Indexing bytes retiurns an integer, not bytes.
Diffstat (limited to 'Lib/sunau.py')
-rw-r--r--Lib/sunau.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/Lib/sunau.py b/Lib/sunau.py
index 3c244925d1..3da41b75e4 100644
--- a/Lib/sunau.py
+++ b/Lib/sunau.py
@@ -210,12 +210,9 @@ class Au_read:
self._framesize = self._framesize * self._nchannels
if self._hdr_size > 24:
self._info = file.read(self._hdr_size - 24)
- for i in range(len(self._info)):
- if self._info[i] == b'\0':
- self._info = self._info[:i]
- break
+ self._info, _, _ = self._info.partition(b'\0')
else:
- self._info = ''
+ self._info = b''
try:
self._data_pos = file.tell()
except (AttributeError, OSError):