Skip to content

Commit

Permalink
Fix a few ugly formattings
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin committed May 22, 2020
1 parent db6d62b commit 00aabdc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
7 changes: 3 additions & 4 deletions trio/_core/tests/test_ki.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,10 +538,9 @@ def test_ki_wakes_us_up():
# https://bitbucket.org/pypy/pypy/issues/2623
import platform

buggy_wakeup_fd = platform.python_implementation() == "CPython" and sys.version_info < (
3,
6,
2,
buggy_wakeup_fd = (
sys.version_info < (3, 6, 2)
and platform.python_implementation() == "CPython"
)

# lock is only needed to avoid an annoying race condition where the
Expand Down
10 changes: 4 additions & 6 deletions trio/_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,13 @@ def _make_simple_sock_method_wrapper(methname, wait_fn, maybe_avail=False):
async def wrapper(self, *args, **kwargs):
return await self._nonblocking_helper(fn, args, kwargs, wait_fn)

wrapper.__doc__ = """Like :meth:`socket.socket.{}`, but async.
wrapper.__doc__ = f"""Like :meth:`socket.socket.{methname}`, but async.
""".format(
methname
)
"""
if maybe_avail:
wrapper.__doc__ += (
"Only available on platforms where :meth:`socket.socket.{}` "
"is available.".format(methname)
f"Only available on platforms where :meth:`socket.socket.{methname}`"
" is available."
)
return wrapper

Expand Down
3 changes: 1 addition & 2 deletions trio/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,12 @@ async def wait_with_ul1():

def test_module_metadata_is_fixed_up():
import trio
import trio.testing

assert trio.Cancelled.__module__ == "trio"
assert trio.open_nursery.__module__ == "trio"
assert trio.abc.Stream.__module__ == "trio.abc"
assert trio.lowlevel.wait_task_rescheduled.__module__ == "trio.lowlevel"
import trio.testing

assert trio.testing.trio_test.__module__ == "trio.testing"

# Also check methods
Expand Down

0 comments on commit 00aabdc

Please sign in to comment.