Skip to content

Commit

Permalink
Fix for unpickling old Arrow data format
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Apr 14, 2017
1 parent 9db9f2d commit ae3c972
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions holoviews/element/annotation.py
Expand Up @@ -154,6 +154,17 @@ def __init__(self, x, y, text='', direction='<',
points=points, arrowstyle=arrowstyle,
**params)

def __setstate__(self, d):
"""
Add compatibility for unpickling old Arrow types with different
.data format.
"""
super(Arrow, self).__setstate__(d)
if len(self.data) == 5:
direction, text, (x, y), points, arrowstyle = self.data
self.data = (x, y, text, direction, points, arrowstyle)


# Note: This version of clone is identical in Text and path.BaseShape
# Consider implementing a mix-in class if it is needed again.
def clone(self, *args, **overrides):
Expand Down

0 comments on commit ae3c972

Please sign in to comment.