8000 mplot3d: Avoid comparing None & numpy arrays · matplotlib/matplotlib@7e0f22a · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7e0f22a

Browse files
committed
mplot3d: Avoid comparing None & numpy arrays
1 parent 1ab4891 commit 7e0f22a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,8 +1008,11 @@ def mouse_init(self, rotate_btn=1, zoom_btn=3):
10081008
else:
10091009
warnings.warn('Axes3D.figure.canvas is \'None\', mouse rotation disabled. Set canvas then call Axes3D.mouse_init().')
10101010

1011-
self._rotate_btn = np.atleast_1d(rotate_btn)
1012-
self._zoom_btn = np.atleast_1d(zoom_btn)
1011+
# coerce scalars into array-like, then convert into
1012+
# a regular list to avoid comparisons against None
1013+
# which breaks in recent versions of numpy.
1014+
self._rotate_btn = np.atleast_1d(rotate_btn).tolist()
1015+
self._zoom_btn = np.atleast_1d(zoom_btn).tolist()
10131016

10141017
def can_zoom(self) :
10151018
"""

0 commit comments

Comments
 (0)
0