Skip to content

Commit

Permalink
bpo-33911: Fixed deprecation warning in xmlrpc.server (pythonGH-7847)
Browse files Browse the repository at this point in the history
Replace deprecated inspect.getfullargspec() with inspect.signature().
  • Loading branch information
Nicolas Noé authored and vstinner committed Jul 16, 2018
1 parent bd47384 commit 35c0809
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions Lib/xmlrpc/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ def export_add(self, x, y):
from xmlrpc.client import Fault, dumps, loads, gzip_encode, gzip_decode
from http.server import BaseHTTPRequestHandler
from functools import partial
from inspect import signature
import http.server
import socketserver
import sys
import os
import re
import pydoc
import inspect
import traceback
try:
import fcntl
Expand Down Expand Up @@ -771,24 +771,8 @@ def docroutine(self, object, name, mod=None,
title = '<a name="%s"><strong>%s</strong></a>' % (
self.escape(anchor), self.escape(name))

if inspect.ismethod(object):
args = inspect.getfullargspec(object)
# exclude the argument bound to the instance, it will be
# confusing to the non-Python user
argspec = inspect.formatargspec (
args.args[1:],
args.varargs,
args.varkw,
args.defaults,
annotations=args.annotations,
formatvalue=self.formatvalue
)
elif inspect.isfunction(object):
args = inspect.getfullargspec(object)
argspec = inspect.formatargspec(
args.args, args.varargs, args.varkw, args.defaults,
annotations=args.annotations,
formatvalue=self.formatvalue)
if callable(object):
argspec = str(signature(object))
else:
argspec = '(...)'

Expand Down

0 comments on commit 35c0809

Please sign in to comment.