From d196120173d85aa5b0e75a5caee78a7bd7b4653f Mon Sep 17 00:00:00 2001 From: 13steinj <13steinj@users.noreply.github.com> Date: Sun, 22 Nov 2015 14:15:39 -0500 Subject: [PATCH] Use inspect.getargspec() for PyPy3 PyPy3 is still using `inspect.getargspec()`, not `inspect.signature()`. --- praw/decorators.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/praw/decorators.py b/praw/decorators.py index 0e38ea497..a9d445285 100644 --- a/praw/decorators.py +++ b/praw/decorators.py @@ -48,8 +48,8 @@ def alias_function(function, class_name): """ @wraps(function) def wrapped(self, *args, **kwargs): - if six.PY3: - # Python3 uses inspect.signature(), not inspect.getargspec() + if six.PY3 and not hasattr(sys, 'pypy_version_info'): + # CPython3 uses inspect.signature(), not inspect.getargspec() # see #551 and #541 for more info func_items = inspect.signature(function).parameters.items() func_args = [name for name, param in func_items @@ -171,8 +171,8 @@ def require_captcha(function, *args, **kwargs): # *args currently contains a None where the captcha answer # needs to go. If we put the captcha in the **kwargs, # we get a TypeError for having two values of the same param. - if six.PY3: - # Python3 uses inspect.signature(), not + if six.PY3 and not hasattr(sys, 'pypy_version_info'): + # CPython3 uses inspect.signature(), not # inspect.getargspec() see #551 and #541 for more info func_items = inspect.signature(function) func_items = func_items.parameters.items()