Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion plotly/matplotlylib/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def warning_on_one_line(msg, category, filename, lineno, file=None, line=None):
return "%s:%s: %s:\n\n%s\n\n" % (filename, lineno, category.__name__, msg)


warnings.formatwarning = warning_on_one_line
# Note: We no longer globally modify warnings.formatwarning to avoid polluting
# the user's warning system. If custom warning formatting is needed internally,
# use warnings.warn_explicit() or format within specific warning calls.


class PlotlyRenderer(Renderer):
Expand Down
4 changes: 3 additions & 1 deletion plotly/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ def warning_on_one_line(message, category, filename, lineno, file=None, line=Non
return "%s:%s: %s:\n\n%s\n\n" % (filename, lineno, category.__name__, message)


warnings.formatwarning = warning_on_one_line
# Note: We no longer globally modify warnings.formatwarning to avoid polluting
# the user's warning system. If custom warning formatting is needed internally,
# use warnings.warn_explicit() or format within specific warning calls.


### mpl-related tools ###
Expand Down