Skip to content

Commit

Permalink
fix errors with latest flake8 (#710)
Browse files Browse the repository at this point in the history
* fix errors with latest flake8

* Also fix the macOS builds

* fix?

* allow urllib3 to fail for now
  • Loading branch information
alex authored and reaperhulk committed Nov 20, 2017
1 parent fe0120f commit c3697ad
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,23 @@ matrix:
- env: TOXENV=py35-cryptographyMaster
- env: TOXENV=py36-cryptographyMaster
- env: TOXENV=pypy-cryptographyMaster
# TODO: undo this once upstream fixes their tests
- python: "3.5"
env: TOXENV=py35-urllib3Master


install:
- |
if [[ "$(uname -s)" == 'Darwin' ]]; then
brew update
if [[ "${OPENSSL}" == "1.1.0" ]]; then
brew install [email protected]
brew upgrade [email protected]
else
brew upgrade openssl
fi
curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user
pip install --user virtualenv
python -m pip install --user virtualenv
else
# install our own pypy. This can be removed if and when Travis gets a reasonably up to date pypy
if [[ "${TOXENV}" = pypy* ]]; then
Expand Down
2 changes: 1 addition & 1 deletion examples/simple/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def dropClient(cli, errors=None):
r, w, _ = select.select(
[server] + list(clients.keys()), list(writers.keys()), []
)
except:
except Exception:
break

for cli in r:
Expand Down
8 changes: 4 additions & 4 deletions src/OpenSSL/SSL.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,10 @@ def wrapper(ssl, out, outlen, in_, inlen, arg):
instr = _ffi.buffer(in_, inlen)[:]
protolist = []
while instr:
l = indexbytes(instr, 0)
proto = instr[1:l + 1]
length = indexbytes(instr, 0)
proto = instr[1:length + 1]
protolist.append(proto)
instr = instr[l + 1:]
instr = instr[length + 1:]

# Call the callback
outstr = callback(conn, protolist)
Expand Down Expand Up @@ -1080,7 +1080,7 @@ def set_client_ca_list(self, certificate_authorities):
if not push_result:
_lib.X509_NAME_free(copy)
_raise_current_error()
except:
except Exception:
_lib.sk_X509_NAME_free(name_stack)
raise

Expand Down
8 changes: 4 additions & 4 deletions tests/test_crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -1846,11 +1846,11 @@ def test_set_subject(self):
cert = X509()
name = cert.get_subject()
name.C = 'AU'
name.O = 'Unit Tests'
name.OU = 'Unit Tests'
cert.set_subject(name)
assert (
cert.get_subject().get_components() ==
[(b'C', b'AU'), (b'O', b'Unit Tests')])
[(b'C', b'AU'), (b'OU', b'Unit Tests')])

def test_get_issuer(self):
"""
Expand Down Expand Up @@ -1882,11 +1882,11 @@ def test_set_issuer(self):
cert = X509()
name = cert.get_issuer()
name.C = 'AU'
name.O = 'Unit Tests'
name.OU = 'Unit Tests'
cert.set_issuer(name)
assert (
cert.get_issuer().get_components() ==
[(b'C', b'AU'), (b'O', b'Unit Tests')])
[(b'C', b'AU'), (b'OU', b'Unit Tests')])

def test_get_pubkey_uninitialized(self):
"""
Expand Down

0 comments on commit c3697ad

Please sign in to comment.