diff --git a/packages/taucmdr/tests/__init__.py b/packages/taucmdr/tests/__init__.py index 05f46bb7d5..48eb1b07a2 100644 --- a/packages/taucmdr/tests/__init__.py +++ b/packages/taucmdr/tests/__init__.py @@ -63,7 +63,10 @@ def push_test_workdir(): Directories created via this method are tracked. If any of them exist when the program exits then an error message is shown for each. """ - path = tempfile.mkdtemp() + try: + path = tempfile.mkdtemp() + except OSError: + path = tmepfile.mkdtemp(dir=os.getcwd()) _DIR_STACK.append(path) _CWD_STACK.append(os.getcwd()) _TEMPDIR_STACK.append(tempfile.tempdir)