diff --git a/src/calibre/utils/speedups.py b/src/calibre/utils/speedups.py index 503d7d7557..31db62b7c3 100644 --- a/src/calibre/utils/speedups.py +++ b/src/calibre/utils/speedups.py @@ -4,10 +4,9 @@ import os -from polyglot.builtins import range, unicode_type -class ReadOnlyFileBuffer(object): +class ReadOnlyFileBuffer: ''' A zero copy implementation of a file like object. Uses memoryviews for efficiency. ''' @@ -68,7 +67,7 @@ def svg_path_to_painter_path(d): # x1/y1 and x2/y2 = bezier control points x = y = x1 = y1 = x2 = y2 = 0 - if isinstance(d, unicode_type): + if isinstance(d, str): d = d.encode('ascii') d = d.replace(b',', b' ').replace(b'\n', b' ') end = len(d)