mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
MOBI Output: Fix download of Chicago Tribune
This commit is contained in:
parent
ec9111aa7f
commit
4af8f1c568
@ -27,7 +27,7 @@ class _ErrorHandler(object):
|
|||||||
"""
|
"""
|
||||||
handles all errors and log messages
|
handles all errors and log messages
|
||||||
"""
|
"""
|
||||||
def __init__(self, log, defaultloglevel=logging.INFO,
|
def __init__(self, log, defaultloglevel=logging.INFO,
|
||||||
raiseExceptions=True):
|
raiseExceptions=True):
|
||||||
"""
|
"""
|
||||||
inits log if none given
|
inits log if none given
|
||||||
@ -51,7 +51,7 @@ class _ErrorHandler(object):
|
|||||||
hdlr.setFormatter(formatter)
|
hdlr.setFormatter(formatter)
|
||||||
self._log.addHandler(hdlr)
|
self._log.addHandler(hdlr)
|
||||||
self._log.setLevel(defaultloglevel)
|
self._log.setLevel(defaultloglevel)
|
||||||
|
|
||||||
self.raiseExceptions = raiseExceptions
|
self.raiseExceptions = raiseExceptions
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
@ -86,10 +86,10 @@ class _ErrorHandler(object):
|
|||||||
if error and self.raiseExceptions and not neverraise:
|
if error and self.raiseExceptions and not neverraise:
|
||||||
if isinstance(error, urllib2.HTTPError) or isinstance(error, urllib2.URLError):
|
if isinstance(error, urllib2.HTTPError) or isinstance(error, urllib2.URLError):
|
||||||
raise
|
raise
|
||||||
elif issubclass(error, xml.dom.DOMException):
|
elif issubclass(error, xml.dom.DOMException):
|
||||||
error.line = line
|
error.line = line
|
||||||
error.col = col
|
error.col = col
|
||||||
raise error(msg, line, col)
|
raise error(msg)
|
||||||
else:
|
else:
|
||||||
raise error(msg)
|
raise error(msg)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user