Skip to content

Commit a2507e2

Browse files
committed
Fix "ValueError: list.remove(x): x not in list" errors (Fix #44)
1 parent e12753c commit a2507e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sphinx_tabs/tabs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,12 @@ def update_context(app, pagename, templatename, context, doctree):
277277
if 'css_files' in context:
278278
context['css_files'] = context['css_files'][:]
279279
for path in paths:
280-
if path.endswith('.css'):
280+
if path.endswith('.css') and path in context['css_files']:
281281
context['css_files'].remove(path)
282282
if 'script_files' in context:
283283
context['script_files'] = context['script_files'][:]
284284
for path in paths:
285-
if path.endswith('.js'):
285+
if path.endswith('.js') and path in context['script_files']:
286286
context['script_files'].remove(path)
287287
# pylint: enable=unused-argument
288288

0 commit comments

Comments
 (0)