8000 Handle prop=None case in AnchoredText.__init__() · matplotlib/matplotlib@190f366 · GitHub
[go: up one dir, main page]

Skip to content

Commit 190f366

Browse files
committed
Handle prop=None case in AnchoredText.__init__()
The line `propkeys = prop.keys()` will raise an AttributeError if `prop` has its default value of None.
1 parent 59e4ada commit 190f366

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/offsetbox.py

Lines changed: 2 additions & 0 deletions
< 46B1 td data-grid-cell-id="diff-c0f3394227ee94f97502e7cfb9b128bb8249d8f68ea51c9e0552ed885bcd81a7-1102-1104-1" data-selected="false" role="gridcell" style="background-color:var(--bgColor-default);text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative diff-line-number-neutral left-side">1104
Original file line numberDiff line numberDiff line change
@@ -1099,6 +1099,8 @@ def __init__(self, s, loc, pad=0.4, borderpad=0.5, prop=None, **kwargs):
10991099
other keyword parameters of AnchoredOffsetbox are also allowed.
11001100
"""
11011101

1102+
if prop is None:
1103+
prop = {}
1102
propkeys = prop.keys()
11031105
badkwargs = ('ha', 'horizontalalignment', 'va', 'verticalalignment')
11041106
if set(badkwargs) & set(propkeys):

0 commit comments

Comments
 (0)
0