curl works with python3 now

This commit is contained in:
hackrush 2018-07-22 18:24:51 +05:30 committed by Jack Robison
parent 78c8c8e64d
commit 473d2eabfa
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
3 changed files with 9 additions and 10 deletions

View file

@ -1,4 +1,3 @@
# pylint: skip-file
import logging
from six.moves.urllib import parse as urlparse
import json
@ -517,7 +516,7 @@ class AuthJSONRPCServer(AuthorizedBase):
@staticmethod
def _check_params(function, args_tup, args_dict):
argspec = inspect.getargspec(undecorated(function))
argspec = inspect.getfullargspec(undecorated(function))
num_optional_params = 0 if argspec.defaults is None else len(argspec.defaults)
duplicate_params = [
@ -537,7 +536,7 @@ class AuthJSONRPCServer(AuthorizedBase):
if len(missing_required_params):
return 'Missing required parameters', missing_required_params
extraneous_params = [] if argspec.keywords is not None else [
extraneous_params = [] if argspec.varkw is not None else [
extra_param
for extra_param in args_dict
if extra_param not in argspec.args[1:]
@ -566,7 +565,7 @@ class AuthJSONRPCServer(AuthorizedBase):
def _callback_render(self, result, request, id_, auth_required=False):
try:
encoded_message = jsonrpc_dumps_pretty(result, id=id_, default=default_decimal)
encoded_message = jsonrpc_dumps_pretty(result, id=id_, default=default_decimal).encode()
request.setResponseCode(200)
self._set_headers(request, encoded_message, auth_required)
self._render_message(request, encoded_message)

View file

@ -348,7 +348,7 @@ class Node(MockKademliaHelper):
stored_to = yield DeferredDict({contact: self.storeToContact(blob_hash, contact) for contact in contacts})
contacted_node_ids = [binascii.hexlify(contact.id) for contact in stored_to.keys() if stored_to[contact]]
log.debug("Stored %s to %i of %i attempted peers", binascii.hexlify(blob_hash),
len(contacted_node_ids), len(contacts))
len(list(contacted_node_ids)), len(contacts))
defer.returnValue(contacted_node_ids)
def change_token(self):

View file

@ -33,11 +33,11 @@ def undecorated(o):
except AttributeError:
pass
# try:
# # python3
# closure = o.__closure__
# except AttributeError:
# return
try:
# python3
closure = o.__closure__
except AttributeError:
return
if closure:
for cell in closure: