mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-29 21:44:46 +01:00
...
This commit is contained in:
parent
31d4b7924a
commit
d7ed14e30c
1 changed files with 3 additions and 2 deletions
|
|
@ -120,7 +120,7 @@ def __init__(self, stream):
|
|||
except:
|
||||
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 '
|
||||
if self.is_console:
|
||||
from ctypes import wintypes, byref, c_wchar_p
|
||||
|
|
@ -150,7 +150,8 @@ def write_unicode_text(self, text):
|
|||
from calibre.utils.filenames import ascii_text
|
||||
print (ascii_text(t + text), file=self.stream, end='')
|
||||
continue
|
||||
raise ctypes.WinError(err)
|
||||
if not ignore_errors:
|
||||
raise ctypes.WinError(err)
|
||||
|
||||
_crt = None
|
||||
def crt():
|
||||
|
|
|
|||
Loading…
Reference in a new issue