Skip to content

Commit

Permalink
Replace usage of deprecated inspect.getargspec
Browse files Browse the repository at this point in the history
  • Loading branch information
aronbierbaum committed Aug 6, 2022
1 parent 61e4487 commit 916f945
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pypiserver/bottle.py
Expand Up @@ -41,7 +41,7 @@
from datetime import date as datedate, datetime, timedelta
from tempfile import TemporaryFile
from traceback import format_exc, print_exc
from inspect import getargspec
from inspect import getfullargspec
from unicodedata import normalize


Expand Down Expand Up @@ -554,7 +554,7 @@ def get_callback_args(self):
''' Return a list of argument names the callback (most likely) accepts
as keyword arguments. If the callback is a decorated function, try
to recover the original function before inspection. '''
return getargspec(self.get_undecorated_callback())[0]
return getfullargspec(self.get_undecorated_callback())[0]

def get_config(self, key, default=None):
''' Lookup a config field and return its value, first checking the
Expand Down Expand Up @@ -2645,7 +2645,7 @@ def yieldroutes(func):
d(x=5, y=6) -> '/d' and '/d/<x>' and '/d/<x>/<y>'
"""
path = '/' + func.__name__.replace('__','/').lstrip('/')
spec = getargspec(func)
spec = getfullargspec(func)
argc = len(spec[0]) - len(spec[3] or [])
path += ('/<%s>' * argc) % tuple(spec[0][:argc])
yield path
Expand Down

0 comments on commit 916f945

Please sign in to comment.