Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump yapf version to 0.20.1 #406

Merged
merged 3 commits into from
Jan 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions ci/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

set -ex

# 0.20.0 is broken (https://github.com/google/yapf/issues/484)
# The fix has been merged so hopefully 0.21.0 will be usable again
YAPF_VERSION=0.19.0
YAPF_VERSION=0.20.1

git rev-parse HEAD

Expand Down
10 changes: 4 additions & 6 deletions trio/_core/tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,8 @@ async def main():
with pytest.raises(_core.MultiError) as excinfo:
_core.run(main)
print(excinfo.value)
assert set(type(exc) for exc in excinfo.value.exceptions) == {
ValueError, KeyError
}
assert set(type(exc)
for exc in excinfo.value.exceptions) == {ValueError, KeyError}


def test_two_child_crashes():
Expand All @@ -201,9 +200,8 @@ async def main():

with pytest.raises(_core.MultiError) as excinfo:
_core.run(main)
assert set(type(exc) for exc in excinfo.value.exceptions) == {
ValueError, KeyError
}
assert set(type(exc)
for exc in excinfo.value.exceptions) == {ValueError, KeyError}


async def test_child_crash_wakes_parent():
Expand Down
4 changes: 2 additions & 2 deletions trio/_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,8 @@ async def _resolve_address(self, address, flags):
if not self._sock.getsockopt(IPPROTO_IPV6, IPV6_V6ONLY):
flags |= AI_V4MAPPED
gai_res = await getaddrinfo(
host, port, self._sock.family,
real_socket_type(self._sock.type), self._sock.proto, flags
host, port, self._sock.family, real_socket_type(self._sock.type),
self._sock.proto, flags
)
# AFAICT from the spec it's not possible for getaddrinfo to return an
# empty list.
Expand Down
4 changes: 2 additions & 2 deletions trio/_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ def __init__(self, total_tokens):
def __repr__(self):
return (
"<trio.CapacityLimiter at {:#x}, {}/{} with {} waiting>".format(
id(self),
len(self._borrowers), self._total_tokens, len(self._lot)
id(self), len(self._borrowers), self._total_tokens,
len(self._lot)
)
)

Expand Down
6 changes: 3 additions & 3 deletions trio/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ async def __aexit__(self, type, value, traceback):
# was passed to throw() and later wrapped into a RuntimeError
# (see PEP 479).
if (
isinstance(value,
(StopIteration, StopAsyncIteration))
and exc.__cause__ is value
isinstance(value,
(StopIteration, StopAsyncIteration))
and exc.__cause__ is value
):
return False
raise
Expand Down
2 changes: 2 additions & 0 deletions trio/testing/_check_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ async def receive_send_then_close():
# we can't do it here. Maybe we could do a bit better with
# https://github.com/python-trio/trio/issues/77
async with _ForceCloseBoth(await stream_maker()) as (s, r):

async def expect_cancelled(afn, *args):
with _assert_raises(_core.Cancelled):
await afn(*args)
Expand Down Expand Up @@ -315,6 +316,7 @@ async def receiver():

# closing the receiver causes wait_send_all_might_not_block to return
async with _ForceCloseBoth(await clogged_stream_maker()) as (s, r):

async def sender():
try:
with assert_checkpoints():
Expand Down