Skip to content

Commit cb5d01a

Browse files
authored
fix errors when {js,css}.filename is None (#41)
1 parent b75620a commit cb5d01a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

deepmodeling_sphinx/inject.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ def minify_js_files(app, exception):
132132
# not html builder
133133
return
134134
for js in app.builder.script_files:
135+
if js.filename is None:
136+
continue
135137
fn = os.path.join(app.builder.outdir, js.filename)
136138
if os.path.isfile(fn):
137139
with open(fn, "r+") as f:
@@ -146,6 +148,8 @@ def minify_css_files(app, exception):
146148
# not html builder
147149
return
148150
for css in app.builder.css_files:
151+
if css.filename is None:
152+
continue
149153
fn = os.path.join(app.builder.outdir, css.filename)
150154
if os.path.isfile(fn):
151155
with open(fn, "r+") as f:

0 commit comments

Comments
 (0)