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