mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #5337 (Conversion Error / NotImplementedError failure on custom news fetch)
This commit is contained in:
parent
54e524c7e1
commit
8a759d7738
@ -96,6 +96,8 @@ class CSSSelector(etree.XPath):
|
|||||||
path = css_to_xpath(css)
|
path = css_to_xpath(css)
|
||||||
except UnicodeEncodeError: # Bug in css_to_xpath
|
except UnicodeEncodeError: # Bug in css_to_xpath
|
||||||
path = '/'
|
path = '/'
|
||||||
|
except NotImplementedError: # Probably a subselect like :hover
|
||||||
|
path = '/'
|
||||||
path = self.LOCAL_NAME_RE.sub(r"local-name() = '", path)
|
path = self.LOCAL_NAME_RE.sub(r"local-name() = '", path)
|
||||||
etree.XPath.__init__(self, path, namespaces=namespaces)
|
etree.XPath.__init__(self, path, namespaces=namespaces)
|
||||||
self.css = css
|
self.css = css
|
||||||
@ -534,6 +536,8 @@ class Style(object):
|
|||||||
result = base
|
result = base
|
||||||
else:
|
else:
|
||||||
result = self._unit_convert(width, base=base)
|
result = self._unit_convert(width, base=base)
|
||||||
|
if isinstance(result, (unicode, str, bytes)):
|
||||||
|
result = self._profile.width
|
||||||
self._width = result
|
self._width = result
|
||||||
return self._width
|
return self._width
|
||||||
|
|
||||||
@ -555,6 +559,8 @@ class Style(object):
|
|||||||
result = base
|
result = base
|
||||||
else:
|
else:
|
||||||
result = self._unit_convert(height, base=base)
|
result = self._unit_convert(height, base=base)
|
||||||
|
if isinstance(result, (unicode, str, bytes)):
|
||||||
|
result = self._profile.height
|
||||||
self._height = result
|
self._height = result
|
||||||
return self._height
|
return self._height
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user