mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
31d4b7924a
commit
d7ed14e30c
@ -120,7 +120,7 @@ class Detect(object):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def write_unicode_text(self, text):
|
def write_unicode_text(self, text, ignore_errors=False):
|
||||||
' Windows only method that writes unicode strings correctly to the windows console using the Win32 API '
|
' Windows only method that writes unicode strings correctly to the windows console using the Win32 API '
|
||||||
if self.is_console:
|
if self.is_console:
|
||||||
from ctypes import wintypes, byref, c_wchar_p
|
from ctypes import wintypes, byref, c_wchar_p
|
||||||
@ -150,7 +150,8 @@ class Detect(object):
|
|||||||
from calibre.utils.filenames import ascii_text
|
from calibre.utils.filenames import ascii_text
|
||||||
print (ascii_text(t + text), file=self.stream, end='')
|
print (ascii_text(t + text), file=self.stream, end='')
|
||||||
continue
|
continue
|
||||||
raise ctypes.WinError(err)
|
if not ignore_errors:
|
||||||
|
raise ctypes.WinError(err)
|
||||||
|
|
||||||
_crt = None
|
_crt = None
|
||||||
def crt():
|
def crt():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user