mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-08-29 02:24:35 -05:00
* manual python 3.8 removals * poetry * pyupgrade * black * isort * manually tidy imports * work around shadowed type * catch up build network protocol files for pyupgrade changes * placate pylint * re-enable 20.04 * placate flake8
15 lines
306 B
Python
15 lines
306 B
Python
from __future__ import annotations
|
|
|
|
import contextlib
|
|
import tempfile
|
|
from collections.abc import Iterator
|
|
from pathlib import Path
|
|
|
|
|
|
@contextlib.contextmanager
|
|
def TempFile() -> Iterator[Path]:
|
|
path = Path(tempfile.NamedTemporaryFile().name)
|
|
yield path
|
|
if path.exists():
|
|
path.unlink()
|