mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 00:13:50 +02:00
py3: Another minor compat fix
This commit is contained in:
parent
ad8d8cfcb5
commit
a89823ae4f
1 changed files with 4 additions and 3 deletions
|
|
@ -6,7 +6,7 @@
|
|||
print_function)
|
||||
|
||||
import os
|
||||
from polyglot.builtins import range
|
||||
from polyglot.builtins import range, unicode_type
|
||||
|
||||
|
||||
class ReadOnlyFileBuffer(object):
|
||||
|
|
@ -70,9 +70,10 @@ def svg_path_to_painter_path(d):
|
|||
# x1/y1 and x2/y2 = bezier control points
|
||||
x = y = x1 = y1 = x2 = y2 = 0
|
||||
|
||||
data = d.replace(b',', b' ').replace(b'\n', b' ')
|
||||
if isinstance(data, type('')):
|
||||
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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue