Keep temporary directories past program exit for debugging.
(cls, set_to=True)
| 87 | @classmethod |
| 88 | @contextlib.contextmanager |
| 89 | def set_keep_for_debug(cls, set_to=True): |
| 90 | """Keep temporary directories past program exit for debugging.""" |
| 91 | old_keep_for_debug = cls._KEEP_FOR_DEBUG |
| 92 | try: |
| 93 | cls._KEEP_FOR_DEBUG = set_to |
| 94 | yield |
| 95 | finally: |
| 96 | cls._KEEP_FOR_DEBUG = old_keep_for_debug |
| 97 | |
| 98 | def __init__(self, custom_path=None, keep_for_debug=None): |
| 99 | if self.TEMPDIRS is None: |