Various fixes for mypy 0.920

This commit is contained in:
Kovid Goyal
2021-12-17 05:41:27 +05:30
parent 6a657eec33
commit 8f0825bc5c
6 changed files with 24 additions and 17 deletions

View File

@@ -389,7 +389,8 @@ def detect_support(wait_for: float = 10, silent: bool = False) -> bool:
return 1 not in responses or 2 not in responses
with NamedTemporaryFile() as f:
f.write(b'abcd'), f.flush()
f.write(b'abcd')
f.flush()
gc = GraphicsCommand()
gc.a = 'q'
gc.s = gc.v = gc.i = 1
@@ -455,7 +456,8 @@ def process_single_item(
try:
if isinstance(item, bytes):
tf = NamedTemporaryFile(prefix='stdin-image-data-', delete=False)
tf.write(item), tf.close()
tf.write(item)
tf.close()
item = tf.name
is_tempfile = True
if url_pat is not None and url_pat.match(item) is not None: