Skip to content

Commit

Permalink
Fixed bug in checking the existence of custom __init__ method in an o…
Browse files Browse the repository at this point in the history
…bject. The __init__ wasn't called previously.
  • Loading branch information
bdabrowski committed Aug 19, 2024
1 parent cfd49b2 commit 04fe33d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion polymorphic/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def transmogrify(cls, obj):
"""
Upcast a class to a different type without asking questions.
"""
if "__init__" not in obj.__dict__:
if "__init__" not in obj.__class__.__dict__:
# Just assign __class__ to a different value.
new = obj
new.__class__ = cls
Expand Down

0 comments on commit 04fe33d

Please sign in to comment.