Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e43c728

Browse files
authored
Merge pull request #13976 from meeseeksmachine/auto-backport-of-pr-13973-on-v3.1.x
Backport PR #13973 on branch v3.1.x (BUG: Ensure docstrings are not accessed with -OO)
2 parents ccf1043 + 56451b2 commit e43c728

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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)