Lazily creates a temporary directory in a secure manner. When Python exits, or the cleanup() function is called, the directory is erased.
()
| 438 | |
| 439 | |
| 440 | def gettempdir(): |
| 441 | """ |
| 442 | Lazily creates a temporary directory in a secure manner. When Python exits, |
| 443 | or the cleanup() function is called, the directory is erased. |
| 444 | """ |
| 445 | global __tempdir |
| 446 | if __tempdir is not None: |
| 447 | return __tempdir |
| 448 | __tempdir = tempfile.mkdtemp() |
| 449 | return __tempdir |
| 450 | |
| 451 | |
| 452 | @atexit.register |
no outgoing calls