1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-17 19:43:34 +02:00

Removed check for python version

This commit is contained in:
2020-04-21 21:06:48 +02:00
parent 3234e4de27
commit de4f8a444b
21 changed files with 54 additions and 246 deletions

View File

@@ -10,7 +10,7 @@ from math import ceil
from ebook_converter import force_unicode, isbytestring, prints, sanitize_file_name
from ebook_converter.constants import (
filesystem_encoding, iswindows, plugins, preferred_encoding, isosx, ispy3
filesystem_encoding, iswindows, plugins, preferred_encoding, isosx
)
from ebook_converter.utils.localization import get_udc
@@ -624,16 +624,3 @@ def copytree_using_links(path, dest, dest_is_parent=True, filecopyfunc=copyfile)
hardlink(src, df)
except Exception:
filecopyfunc(src, df)
if not ispy3 and not iswindows:
# On POSIX in python2 if you pass a unicode path to rmtree
# it tries to decode all filenames it encounters while walking
# the tree which leads to unicode errors on Linux where there
# can be non-decodeable filenames.
def rmtree(x, **kw):
if not isinstance(x, bytes):
x = x.encode('utf-8')
return shutil.rmtree(x, **kw)
else:
rmtree = shutil.rmtree