Create an empty, named, temporary file for the duration of the context.
(name)
| 386 | |
| 387 | @contextmanager |
| 388 | def make_tempfile(name): |
| 389 | """Create an empty, named, temporary file for the duration of the context.""" |
| 390 | open(name, "w", encoding="utf-8").close() |
| 391 | try: |
| 392 | yield |
| 393 | finally: |
| 394 | os.unlink(name) |
| 395 | |
| 396 | def fake_input(inputs): |
| 397 | """Temporarily replace the input() function to return the given values |
searching dependent graphs…