Skip to content

Commit

Permalink
Use inspect.getargspec() for PyPy3
Browse files Browse the repository at this point in the history
PyPy3 is still using `inspect.getargspec()`, not `inspect.signature()`.
  • Loading branch information
13steinj committed Nov 22, 2015
1 parent d89a791 commit d196120
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions praw/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit d196120

Please sign in to comment.