From d14acdaf672db12af1c8904fa906076f522ec558 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 26 Jun 2019 20:27:17 +0530 Subject: [PATCH] py3: Port one more execfile() --- src/calibre/utils/rapydscript.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/utils/rapydscript.py b/src/calibre/utils/rapydscript.py index 0e3d22902c..fda31d5761 100644 --- a/src/calibre/utils/rapydscript.py +++ b/src/calibre/utils/rapydscript.py @@ -88,9 +88,9 @@ var vfs = VFS; function read_file_sync(name) { var ans = vfs[name]; - if (ans) return ans; + if (typeof ans === "string") return ans; ans = write_cache[name]; - if (ans) return ans; + if (typeof ans === "string") return ans; return null; } @@ -288,7 +288,7 @@ def compile_viewer(): base = base_dir() iconf = os.path.join(base, 'imgsrc', 'srv', 'generate.py') g = {'__file__': iconf} - execfile(iconf, g) + exec_path(iconf, g) icons = g['merge']().encode('utf-8') with lopen(os.path.join(base, 'resources', 'content-server', 'reset.css'), 'rb') as f: reset = f.read()