8000 Backport PR #13973: BUG: Ensure docstrings are not accessed with -OO · matplotlib/matplotlib@56451b2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 56451b2

Browse files
dstansbyMeeseeksDev[bot]
authored andcommitted
Backport PR #13973: BUG: Ensure docstrings are not accessed with -OO
1 parent ccf1043 commit 56451b2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/scale.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,8 +741,10 @@ def scale_factory(scale, axis, **kwargs):
741741
if scale not in _scale_mapping:
742742
raise ValueError("Unknown scale type '%s'" % scale)
743743
return _scale_mapping[scale](axis, **kwargs)
744-
scale_factory.__doc__ = scale_factory.__doc__ % {
745-
"names": ", ".join(get_scale_names())}
744+
745+
if scale_factory.__doc__:
746+
scale_factory.__doc__ = scale_factory.__doc__ % {
747+
"names": ", ".join(get_scale_names())}
746748

747749

748750
def register_scale(scale_class):

0 commit comments

Comments
 (0)
0