mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 18:43:35 +02:00
...
This commit is contained in:
parent
73df11e69e
commit
45a4c8c867
1 changed files with 3 additions and 3 deletions
|
|
@ -305,12 +305,12 @@ def resource_adder(self, link_, base=None):
|
|||
def css_import_handler(self, base, href):
|
||||
link, frag = self.link_to_local_path(href, base=base)
|
||||
if link is None or not os.access(link, os.R_OK) or os.path.isdir(link):
|
||||
return (None, None)
|
||||
return None, None
|
||||
try:
|
||||
with open(link, 'rb') as f:
|
||||
raw = f.read().decode('utf-8', 'replace')
|
||||
raw = self.oeb.css_preprocessor(raw, add_namespace=False)
|
||||
except:
|
||||
self.log.exception('Failed to read CSS file: %r'%link)
|
||||
return (None, None)
|
||||
return (None, raw)
|
||||
return None, None
|
||||
return None, raw
|
||||
|
|
|
|||
Loading…
Reference in a new issue