From 690ba43dcce4dd779323d582bd4535dbe6971385 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 2 Apr 2019 10:09:00 +0530 Subject: [PATCH] oops --- src/calibre/utils/speedups.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/calibre/utils/speedups.py b/src/calibre/utils/speedups.py index 22abdaf64a..b51848e748 100644 --- a/src/calibre/utils/speedups.py +++ b/src/calibre/utils/speedups.py @@ -70,12 +70,11 @@ def svg_path_to_painter_path(d): # x1/y1 and x2/y2 = bezier control points x = y = x1 = y1 = x2 = y2 = 0 - data = d - if isinstance(data, unicode_type): - data = data.encode('ascii') - data = d.replace(b',', b' ').replace(b'\n', b' ') - end = len(data) - data = ReadOnlyFileBuffer(data) + if isinstance(d, unicode_type): + d = d.encode('ascii') + d = d.replace(b',', b' ').replace(b'\n', b' ') + end = len(d) + data = ReadOnlyFileBuffer(d) def parse_float(): chars = []