diff options
author | Yury Selivanov <yury@magic.io> | 2017-12-10 23:36:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-10 23:36:12 (GMT) |
commit | 6370f345e1d5829e1fba59cd695c8b82c5a8c620 (patch) | |
tree | ba648772068abc784cef9e7b2e0be159646d7514 /Lib/asyncio/windows_utils.py | |
parent | c4d9df5fd719ad08e68e0950ce22a80f43e4f35d (diff) | |
download | cpython-6370f345e1d5829e1fba59cd695c8b82c5a8c620.zip cpython-6370f345e1d5829e1fba59cd695c8b82c5a8c620.tar.gz cpython-6370f345e1d5829e1fba59cd695c8b82c5a8c620.tar.bz2 |
bpo-32262: Fix codestyle; use f-strings formatting where necessary. (#4775)
Diffstat (limited to 'Lib/asyncio/windows_utils.py')
-rw-r--r-- | Lib/asyncio/windows_utils.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/Lib/asyncio/windows_utils.py b/Lib/asyncio/windows_utils.py index 3b41097..9e22f6e 100644 --- a/Lib/asyncio/windows_utils.py +++ b/Lib/asyncio/windows_utils.py @@ -1,6 +1,4 @@ -""" -Various Windows specific bits and pieces -""" +"""Various Windows specific bits and pieces.""" import sys @@ -11,13 +9,12 @@ import _winapi import itertools import msvcrt import os -import socket import subprocess import tempfile import warnings -__all__ = ['pipe', 'Popen', 'PIPE', 'PipeHandle'] +__all__ = 'pipe', 'Popen', 'PIPE', 'PipeHandle' # Constants/globals @@ -34,8 +31,9 @@ _mmap_counter = itertools.count() def pipe(*, duplex=False, overlapped=(True, True), bufsize=BUFSIZE): """Like os.pipe() but with overlapped support and using handles not fds.""" - address = tempfile.mktemp(prefix=r'\\.\pipe\python-pipe-%d-%d-' % - (os.getpid(), next(_mmap_counter))) + address = tempfile.mktemp( + prefix=r'\\.\pipe\python-pipe-{:d}-{:d}-'.format( + os.getpid(), next(_mmap_counter))) if duplex: openmode = _winapi.PIPE_ACCESS_DUPLEX @@ -90,10 +88,10 @@ class PipeHandle: def __repr__(self): if self._handle is not None: - handle = 'handle=%r' % self._handle + handle = f'handle={self._handle!r}' else: handle = 'closed' - return '<%s %s>' % (self.__class__.__name__, handle) + return f'<{self.__class__.__name__} {handle}>' @property def handle(self): @@ -111,7 +109,7 @@ class PipeHandle: def __del__(self): if self._handle is not None: - warnings.warn("unclosed %r" % self, ResourceWarning, + warnings.warn(f"unclosed {self!r}", ResourceWarning, source=self) self.close() |