mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3: Another minor compat fix
This commit is contained in:
parent
ad8d8cfcb5
commit
a89823ae4f
@ -6,7 +6,7 @@ from __future__ import (unicode_literals, division, absolute_import,
|
|||||||
print_function)
|
print_function)
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from polyglot.builtins import range
|
from polyglot.builtins import range, unicode_type
|
||||||
|
|
||||||
|
|
||||||
class ReadOnlyFileBuffer(object):
|
class ReadOnlyFileBuffer(object):
|
||||||
@ -70,9 +70,10 @@ def svg_path_to_painter_path(d):
|
|||||||
# x1/y1 and x2/y2 = bezier control points
|
# x1/y1 and x2/y2 = bezier control points
|
||||||
x = y = x1 = y1 = x2 = y2 = 0
|
x = y = x1 = y1 = x2 = y2 = 0
|
||||||
|
|
||||||
data = d.replace(b',', b' ').replace(b'\n', b' ')
|
data = d
|
||||||
if isinstance(data, type('')):
|
if isinstance(data, unicode_type):
|
||||||
data = data.encode('ascii')
|
data = data.encode('ascii')
|
||||||
|
data = d.replace(b',', b' ').replace(b'\n', b' ')
|
||||||
end = len(data)
|
end = len(data)
|
||||||
data = ReadOnlyFileBuffer(data)
|
data = ReadOnlyFileBuffer(data)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user