diff options
author | Dmitry Shachnev <mitya57@gmail.com> | 2014-01-20 18:32:47 +0400 |
---|---|---|
committer | Dmitry Shachnev <mitya57@gmail.com> | 2014-01-20 18:32:47 +0400 |
commit | c2eaf2af81c1c0bce89ce8e4e43d853ac768c8f3 (patch) | |
tree | bb18c53d431f98cb3a33df663efe9093af0775ea /sphinx/util/inspect.py | |
parent | 8115aa81a2972a5cc20b8d7c244c52e792ecad98 (diff) | |
parent | ce2185ce279664e54ba22b14663091abc5a3a8f2 (diff) | |
download | sphinx-git-c2eaf2af81c1c0bce89ce8e4e43d853ac768c8f3.tar.gz |
Merge
Diffstat (limited to 'sphinx/util/inspect.py')
-rw-r--r-- | sphinx/util/inspect.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py index c7556d056..d835bc41e 100644 --- a/sphinx/util/inspect.py +++ b/sphinx/util/inspect.py @@ -60,7 +60,7 @@ else: # 2.6, 2.7 def getargspec(func): """Like inspect.getargspec but supports functools.partial as well.""" if inspect.ismethod(func): - func = func.im_func + func = func.__func__ parts = 0, () if type(func) is partial: keywords = func.keywords @@ -70,8 +70,8 @@ else: # 2.6, 2.7 func = func.func if not inspect.isfunction(func): raise TypeError('%r is not a Python function' % func) - args, varargs, varkw = inspect.getargs(func.func_code) - func_defaults = func.func_defaults + args, varargs, varkw = inspect.getargs(func.__code__) + func_defaults = func.__defaults__ if func_defaults is None: func_defaults = [] else: |