From 23950954cac1ea7f701c3933fe916873ec4c0892 2013-07-13 00:41:18 From: MinRK Date: 2013-07-13 00:41:18 Subject: [PATCH] don't double-decorate in `flag_calls` --- diff --git a/IPython/utils/decorators.py b/IPython/utils/decorators.py index 208bf83..c264855 100644 --- a/IPython/utils/decorators.py +++ b/IPython/utils/decorators.py @@ -33,6 +33,10 @@ def flag_calls(func): Testing for truth in wrapper.called allows you to determine if a call to func() was attempted and succeeded.""" + + # don't wrap twice + if hasattr(func, 'called'): + return func def wrapper(*args,**kw): wrapper.called = False