fix a file descriptor leak in the temporary file code

Summary:
The new temporary file code added in D20885160 was missing a call to close the
underlying file in the `__exit__()` function.

Reviewed By: xavierd

Differential Revision: D21271901

fbshipit-source-id: 653258d471421edd08b473654ae3d0503f3c6829
This commit is contained in:
Adam Simpkins 2020-04-28 12:09:40 -07:00 committed by Facebook GitHub Bot
parent 4eeab3b81b
commit 606e928233

View File

@ -192,7 +192,7 @@ class TemporaryFileBase(Generic[IOType]):
exc_value: Optional[BaseException],
tb: Optional[types.TracebackType],
) -> None:
pass
self.file.close()
class TemporaryTextFile(TemporaryFileBase[TextIO]):