(root)
| 176 | |
| 177 | @contextlib.contextmanager |
| 178 | def chdir(root): |
| 179 | if root == '.': |
| 180 | yield |
| 181 | return |
| 182 | cwd = os.getcwd() |
| 183 | os.chdir(root) |
| 184 | try: |
| 185 | yield |
| 186 | except BaseException as exc: |
| 187 | raise exc |
| 188 | finally: |
| 189 | os.chdir(cwd) |
| 190 | |
| 191 | |
| 192 | def reliability_guard(maximum_memory_bytes=None): |