From eca6e320ab45a300c55ca1d42195b88266989634 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 22 May 2013 23:28:42 +0530 Subject: [PATCH] ebook-viewer: Fix --debug-javascript option causing an error when running frmo a binary build on os x and linux --- src/calibre/gui2/viewer/javascript.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/viewer/javascript.py b/src/calibre/gui2/viewer/javascript.py index 108266454a..0f05a804dc 100644 --- a/src/calibre/gui2/viewer/javascript.py +++ b/src/calibre/gui2/viewer/javascript.py @@ -41,7 +41,6 @@ class JavaScriptLoader(object): 'hyphenation', 'hyphenator', 'utils', 'cfi', 'indexing', 'paged', 'fs', 'math', 'extract') - def __init__(self, dynamic_coffeescript=False): self._dynamic_coffeescript = dynamic_coffeescript if self._dynamic_coffeescript: @@ -68,7 +67,8 @@ class JavaScriptLoader(object): allow_user_override=False).decode('utf-8') else: dynamic = (self._dynamic_coffeescript and - os.path.exists(calibre.__file__)) + calibre.__file__ and not calibre.__file__.endswith('.pyo') and + os.path.exists(calibre.__file__)) ans = compiled_coffeescript(src, dynamic=dynamic).decode('utf-8') self._cache[name] = ans @@ -105,4 +105,3 @@ class JavaScriptLoader(object): evaljs('\n\n'.join(self._hp_cache.itervalues())) return lang -