def decorated(*args, **kw): gci = getCallerInfo() caller = gci[0] + '()' if gci[2]: caller = gci[2] + '.' + caller message = 'The unimplemented method ' message += '%s() was called by %s' % (f.func_name, caller) raise NotImplementedError(message)