Skip to content

Commit

Permalink
Merge pull request #3111 from montefra/mlab_bug
Browse files Browse the repository at this point in the history
bug fix: check the type of the 'key' of the two array 'r1' and 'r2'
  • Loading branch information
tacaswell committed Jun 4, 2014
2 parents ba72279 + 590eeb8 commit 33e95c5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/matplotlib/mlab.py
Expand Up @@ -2631,8 +2631,11 @@ def key_desc(name):
if dt1.type != np.string_:
return (name, dt1.descr[0][1])

dt2 = r1.dtype[name]
assert dt2==dt1
dt2 = r2.dtype[name]
if dt1 != dt2:
msg = "The '{}' fields in arrays 'r1' and 'r2' must have the same"
msg += " dtype."
raise ValueError(msg.format(name))
if dt1.num>dt2.num:
return (name, dt1.descr[0][1])
else:
Expand Down

0 comments on commit 33e95c5

Please sign in to comment.