bpo-32262: Fix codestyle; use f-strings formatting where necessary. (#4775)

This commit is contained in:
Yury Selivanov 2017-12-10 18:36:12 -05:00 committed by GitHub
parent c4d9df5fd7
commit 6370f345e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 332 additions and 348 deletions

View file

@ -1,8 +1,9 @@
"""Abstract Transport class."""
__all__ = ['BaseTransport', 'ReadTransport', 'WriteTransport',
'Transport', 'DatagramTransport', 'SubprocessTransport',
]
__all__ = (
'BaseTransport', 'ReadTransport', 'WriteTransport',
'Transport', 'DatagramTransport', 'SubprocessTransport',
)
class BaseTransport:
@ -267,7 +268,7 @@ class _FlowControlMixin(Transport):
def _maybe_resume_protocol(self):
if (self._protocol_paused and
self.get_write_buffer_size() <= self._low_water):
self.get_write_buffer_size() <= self._low_water):
self._protocol_paused = False
try:
self._protocol.resume_writing()
@ -285,14 +286,16 @@ class _FlowControlMixin(Transport):
def _set_write_buffer_limits(self, high=None, low=None):
if high is None:
if low is None:
high = 64*1024
high = 64 * 1024
else:
high = 4*low
high = 4 * low
if low is None:
low = high // 4
if not high >= low >= 0:
raise ValueError('high (%r) must be >= low (%r) must be >= 0' %
(high, low))
raise ValueError(
f'high ({high!r}) must be >= low ({low!r}) must be >= 0')
self._high_water = high
self._low_water = low