File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed
Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -78,16 +78,23 @@ def generate_docs_configuration(
7878 # if custom_css and custom_js are strings and they exist as paths, read them as Paths
7979 # otherwise, assume the content is directly provided
8080 if isinstance (custom_css , str ):
81- css_path = Path (custom_css )
82- if css_path .exists ():
83- custom_css = css_path .read_text ()
84- elif isinstance (custom_css , Path ):
81+ custom_css_path = Path (custom_css )
82+ # if the path is too long, it will throw
83+ try :
84+ if custom_css_path .exists ():
85+ custom_css = custom_css_path .read_text ()
86+ except OSError :
87+ pass
88+ else :
8589 custom_css = custom_css .read_text ()
8690 if isinstance (custom_js , str ):
87- js_path = Path (custom_js )
88- if js_path .exists ():
89- custom_js = js_path .read_text ()
90- elif isinstance (custom_js , Path ):
91+ custom_js_path = Path (custom_js )
92+ try :
93+ if custom_js_path .exists ():
94+ custom_js = custom_js_path .read_text ()
95+ except OSError :
96+ pass
97+ else :
9198 custom_js = custom_js .read_text ()
9299
93100 source_dir = os .path .curdir
You can’t perform that action at this time.
0 commit comments