Zachary Turner 7a5382de82 Move some of the common decorators to decorators.py.
This doesn't attempt to move every decorator.  The reason for
this is that it requires touching every single test file to import
decorators.py.  I would like to do this in a followup patch, but
in the interest of keeping the patches as bite-sized as possible,
I've only attempted to move the underlying common decorators first.
A few tests call these directly, so those tests are updated as part
of this patch.

llvm-svn: 259807
2016-02-04 18:03:01 +00:00

17 lines
378 B
Python

from __future__ import print_function
from __future__ import absolute_import
# System modules
import inspect
# Third-party modules
# LLDB modules
def requires_self(func):
func_argc = len(inspect.getargspec(func).args)
if func_argc == 0 or (getattr(func,'im_self', None) is not None) or (hasattr(func, '__self__')):
return False
else:
return True