mirror of
https://github.com/datahub-project/datahub.git
synced 2025-07-05 16:22:17 +00:00
14 lines
196 B
Python
14 lines
196 B
Python
![]() |
import contextlib
|
||
|
import os
|
||
|
|
||
|
|
||
|
@contextlib.contextmanager
|
||
|
def isolated_filesystem(temp_dir):
|
||
|
cwd = os.getcwd()
|
||
|
|
||
|
os.chdir(temp_dir)
|
||
|
try:
|
||
|
yield
|
||
|
finally:
|
||
|
os.chdir(cwd)
|