From 4ef845f5928d8aab3ae97f30fa0c93dc058380bb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 29 Apr 2014 11:14:03 +0530 Subject: [PATCH] Edit Book: Fix an error when merging CSS stylesheets that contain @charset rules --- src/calibre/ebooks/oeb/polish/split.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/polish/split.py b/src/calibre/ebooks/oeb/polish/split.py index 0c7effabb4..dac0c9b4d7 100644 --- a/src/calibre/ebooks/oeb/polish/split.py +++ b/src/calibre/ebooks/oeb/polish/split.py @@ -419,7 +419,7 @@ def merge_css(container, names, master): # Remove charset rules cr = [r for r in sheet.cssRules if r.type == r.CHARSET_RULE] - [sheet.remove(r) for r in cr] + [sheet.deleteRule(sheet.cssRules.index(r)) for r in cr] for rule in sheet.cssRules: msheet.add(rule)