diff --git a/arviz/plots/backends/__init__.py b/arviz/plots/backends/__init__.py index 76970226e1..bd08073377 100644 --- a/arviz/plots/backends/__init__.py +++ b/arviz/plots/backends/__init__.py @@ -213,10 +213,11 @@ def _copy_docstring(lib, function): # TODO: try copying substitutions too, or autoreplace them ourselves -output_notebook.__doc__ += "\n\n" + _copy_docstring("bokeh.plotting", "output_notebook").replace( - "|save|", "save" -).replace("|show|", "show") -output_file.__doc__ += "\n\n" + _copy_docstring("bokeh.plotting", "output_file").replace( - "|save|", "save" -).replace("|show|", "show") -ColumnDataSource.__doc__ += "\n\n" + _copy_docstring("bokeh.models", "ColumnDataSource") +if output_notebook.__doc__ is not None: # if run with python -OO, __doc__ is stripped + output_notebook.__doc__ += "\n\n" + _copy_docstring( + "bokeh.plotting", "output_notebook" + ).replace("|save|", "save").replace("|show|", "show") + output_file.__doc__ += "\n\n" + _copy_docstring("bokeh.plotting", "output_file").replace( + "|save|", "save" + ).replace("|show|", "show") + ColumnDataSource.__doc__ += "\n\n" + _copy_docstring("bokeh.models", "ColumnDataSource")