Convert to tuple before passing to requests

Requests accesses the cert tuple like this:

    if isinstance(cert, basestring):
        a = cert
    else:
        a = cert[0]
        b = cert[1]

On Python 3, map doesn't return a list, so (theoretically) this would
fail.
This commit is contained in:
Markus Unterwaditzer 2015-02-26 12:22:10 +01:00
parent 114c73537e
commit 33d9d7d93e

View file

@ -41,7 +41,7 @@ def prepare_client_cert(cert):
if isinstance(cert, (text_type, bytes)):
cert = expand_path(cert)
elif isinstance(cert, list):
cert = map(prepare_client_cert, cert)
cert = tuple(map(prepare_client_cert, cert))
return cert