Skip to content

Commit 8e754fb

Browse files
committed
fix typing
1 parent 04f9253 commit 8e754fb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/sage/misc/temporary_file.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import atexit
2727
import os
2828
import tempfile
29+
from typing import IO
2930

3031
# Until tmp_dir() and tmp_filename() are removed, we use this directory
3132
# as the parent for all temporary files & directories created by them.
@@ -322,7 +323,7 @@ def __init__(self, target_filename, append=False, mode=0o666,
322323
self.binary = binary
323324
self.kwargs = kwargs
324325

325-
def __enter__(self) -> str:
326+
def __enter__(self) -> IO:
326327
"""
327328
Create and return a temporary file in ``self.tmpdir`` (normally
328329
the same directory as the target file).
@@ -469,7 +470,7 @@ def __init__(self, target_directory) -> None:
469470
self.target = os.path.realpath(target_directory)
470471
self.tmpdir = os.path.dirname(self.target)
471472

472-
def __enter__(self) -> str:
473+
def __enter__(self):
473474
r"""
474475
Create and return a temporary directory in ``self.tmpdir`` (normally
475476
the same directory as the target file).

0 commit comments

Comments
 (0)