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

Skip to content

Commit f55f196

Browse files
montefratobias47n9e
authored andcommitted
bug fix: check the type of the 'key' of the two array 'r1' and 'r2'
1 parent f420bfe commit f55f196

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/matplotlib/mlab.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2631,8 +2631,11 @@ def key_desc(name):
26312631
if dt1.type != np.string_:
26322632
return (name, dt1.descr[0][1])
26332633

2634-
dt2 = r1.dtype[name]
2635-
assert dt2==dt1
2634+
dt2 = r2.dtype[name]
2635+
if dt1 != dt2:
2636+
msg = "The type of the '{}' in the arrays 'r1' and 'r2' must be of"
2637+
msg += " the same type"
2638+
raise ValueError(msg.format(name))
26362639
if dt1.num>dt2.num:
26372640
return (name, dt1.descr[0][1])
26382641
else:

0 commit comments

Comments
 (0)