Merge "Switch get(full)argspec function according to python version"
This commit is contained in:
commit
b04e7c2e53
@ -935,9 +935,15 @@ def fake_http_connect(*code_iter, **kwargs):
|
||||
|
||||
if 'give_connect' in kwargs:
|
||||
give_conn_fn = kwargs['give_connect']
|
||||
argspec = inspect.getargspec(give_conn_fn)
|
||||
if argspec.keywords or 'connection_id' in argspec.args:
|
||||
ckwargs['connection_id'] = i
|
||||
|
||||
if six.PY2:
|
||||
argspec = inspect.getargspec(give_conn_fn)
|
||||
if argspec.keywords or 'connection_id' in argspec.args:
|
||||
ckwargs['connection_id'] = i
|
||||
else:
|
||||
argspec = inspect.getfullargspec(give_conn_fn)
|
||||
if argspec.varkw or 'connection_id' in argspec.args:
|
||||
ckwargs['connection_id'] = i
|
||||
give_conn_fn(*args, **ckwargs)
|
||||
etag = next(etag_iter)
|
||||
headers = next(headers_iter)
|
||||
|
Loading…
x
Reference in New Issue
Block a user