From cb5d01aab54e221bd28957404a06754f6ffcd92b Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sat, 26 Aug 2023 14:13:18 -0400 Subject: [PATCH] fix errors when {js,css}.filename is None (#41) --- deepmodeling_sphinx/inject.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deepmodeling_sphinx/inject.py b/deepmodeling_sphinx/inject.py index 5635f75..d711a8f 100644 --- a/deepmodeling_sphinx/inject.py +++ b/deepmodeling_sphinx/inject.py @@ -132,6 +132,8 @@ def minify_js_files(app, exception): # not html builder return for js in app.builder.script_files: + if js.filename is None: + continue fn = os.path.join(app.builder.outdir, js.filename) if os.path.isfile(fn): with open(fn, "r+") as f: @@ -146,6 +148,8 @@ def minify_css_files(app, exception): # not html builder return for css in app.builder.css_files: + if css.filename is None: + continue fn = os.path.join(app.builder.outdir, css.filename) if os.path.isfile(fn): with open(fn, "r+") as f: