From 20bbe0c62d1f76da9098cb2b07b575c7b6a4094f 2019-01-24 00:06:22 From: Matthias Bussonnier Date: 2019-01-24 00:06:22 Subject: [PATCH] Merge pull request #11568 from sanyam5/master autoreload: explicitly check for True when updating attributes --- diff --git a/IPython/extensions/autoreload.py b/IPython/extensions/autoreload.py index ca6be10..4edd3b3 100644 --- a/IPython/extensions/autoreload.py +++ b/IPython/extensions/autoreload.py @@ -274,7 +274,9 @@ def update_class(old, new): old_obj = getattr(old, key) try: new_obj = getattr(new, key) - if old_obj == new_obj: + # explicitly checking that comparison returns True to handle + # cases where `==` doesn't return a boolean. + if (old_obj == new_obj) is True: continue except AttributeError: # obsolete attribute: remove it