1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-03-10 11:35:50 +01:00

Removed another unicode/string nonsense

This commit is contained in:
2020-04-23 19:51:25 +02:00
parent de4f8a444b
commit 16d169d0d6
13 changed files with 20 additions and 86 deletions

View File

@@ -6,13 +6,8 @@ from ebook_converter import strftime
from ebook_converter.constants import iswindows, isosx, plugins, preferred_encoding
from ebook_converter.utils.iso8601 import utc_tz, local_tz, UNDEFINED_DATE
from ebook_converter.utils.localization import lcdata
from ebook_converter.polyglot.builtins import native_string_type
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
_utc_tz = utc_tz
_local_tz = local_tz
@@ -39,7 +34,7 @@ else:
def first_index(raw, queries):
for q in queries:
try:
return raw.index(native_string_type(q))
return raw.index(q)
except ValueError:
pass
return -1
@@ -191,8 +186,7 @@ def isoformat(date_time, assume_utc=False, as_utc=True, sep='T'):
date_time = date_time.replace(tzinfo=_utc_tz if assume_utc else
_local_tz)
date_time = date_time.astimezone(_utc_tz if as_utc else _local_tz)
# native_string_type(sep) because isoformat barfs with unicode sep on python 2.x
return str(date_time.isoformat(native_string_type(sep)))
return str(date_time.isoformat(sep))
def internal_iso_format_string():