Skip to content

Commit

Permalink
Fix diff bug with oldstyle classes (Python 2) (#302)
Browse files Browse the repository at this point in the history
* Fix oldstyle-class bug in diff

* Use __class__ by default, fallback to type()
  • Loading branch information
Sergei Fomin authored and mmckerns committed Feb 15, 2019
1 parent 325144e commit f6a17a0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dill/__diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ def get_seq(obj, cache={str: False, frozenset: False, list: True, set: True,
"""
Gets all the items in a sequence or return None
"""
o_type = type(obj)
try:
o_type = obj.__class__
except AttributeError:
o_type = type(obj)
hsattr = hasattr
if o_type in cache:
if cache[o_type]:
Expand Down

0 comments on commit f6a17a0

Please sign in to comment.