8000 Merge pull request #13973 from ksunden/fix_OO · matplotlib/matplotlib@2f046b4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2f046b4

Browse files
authored
Merge pull request #13973 from ksunden/fix_OO
BUG: Ensure docstrings are not accessed with -OO
2 parents df2a26d + efd44e5 commit 2f046b4

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