forked from pool/python-Pympler
(and in 3.11 removed) method inspect.getargspec (gh#pympler/pympler#148). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pympler?expand=0&rev=13
34 lines
1.3 KiB
Diff
34 lines
1.3 KiB
Diff
---
|
|
pympler/util/bottle.py | 6 +++---
|
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
--- a/pympler/util/bottle.py
|
|
+++ b/pympler/util/bottle.py
|
|
@@ -41,7 +41,7 @@ import base64, cgi, email.utils, functoo
|
|
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
|
|
|
|
|
|
@@ -554,7 +554,7 @@ class Route(object):
|
|
''' 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
|
|
@@ -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
|