Skip to content

Commit

Permalink
AC3: Python 2 compatibility fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
phw committed Oct 11, 2019
1 parent c1e35a2 commit 5a9b85f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mutagen/ac3.py
Expand Up @@ -86,7 +86,7 @@ class AC3Info(object):
@convert_error(IndexError, AC3Error)
def __init__(self, fileobj):
"""Raises AC3Error"""
header = fileobj.read(6)
header = bytearray(fileobj.read(6))
if not header.startswith(b"\x0b\x77"):
raise AC3Error("not a AC3 file")

Expand Down Expand Up @@ -265,10 +265,10 @@ def _guess_length(self, fileobj):
start = fileobj.tell()
fileobj.seek(0, 2)
length = fileobj.tell() - start
return 8 * length / self.bitrate
return 8.0 * length / self.bitrate

def pprint(self):
return "%s, %d Hz, %.2f seconds, %d channel(s), %d bps" % (
return u"%s, %d Hz, %.2f seconds, %d channel(s), %d bps" % (
self.type_, self.sample_rate, self.length, self.channels,
self.bitrate)

Expand Down

0 comments on commit 5a9b85f

Please sign in to comment.