Skip to content

Commit 0868c9e

Browse files
handle python -OO (#2393)
* handle python -OO * apply black
1 parent 9411317 commit 0868c9e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

arviz/plots/backends/__init__.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,11 @@ def _copy_docstring(lib, function):
213213

214214

215215
# TODO: try copying substitutions too, or autoreplace them ourselves
216-
output_notebook.__doc__ += "\n\n" + _copy_docstring("bokeh.plotting", "output_notebook").replace(
217-
"|save|", "save"
218-
).replace("|show|", "show")
219-
output_file.__doc__ += "\n\n" + _copy_docstring("bokeh.plotting", "output_file").replace(
220-
"|save|", "save"
221-
).replace("|show|", "show")
222-
ColumnDataSource.__doc__ += "\n\n" + _copy_docstring("bokeh.models", "ColumnDataSource")
216+
if output_notebook.__doc__ is not None: # if run with python -OO, __doc__ is stripped
217+
output_notebook.__doc__ += "\n\n" + _copy_docstring(
218+
"bokeh.plotting", "output_notebook"
219+
).replace("|save|", "save").replace("|show|", "show")
220+
output_file.__doc__ += "\n\n" + _copy_docstring("bokeh.plotting", "output_file").replace(
221+
"|save|", "save"
222+
).replace("|show|", "show")
223+
ColumnDataSource.__doc__ += "\n\n" + _copy_docstring("bokeh.models", "ColumnDataSource")

0 commit comments

Comments
 (0)