Skip to content

Commit

Permalink
Create test workdir in cwd on error
Browse files Browse the repository at this point in the history
  • Loading branch information
khsa1 committed Jul 13, 2019
1 parent b0d8f73 commit 780cbe1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/taucmdr/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

This comment has been minimized.

Copy link
@nchaimov

nchaimov Jul 18, 2019

Member

There is a typo in this (tmepfile). I also don't think this approach to fix issue #323 will work, as a non-executable /tmp can still be written into. The problem only appears when trying to execute a program that was compiled and written into /tmp.

_DIR_STACK.append(path)
_CWD_STACK.append(os.getcwd())
_TEMPDIR_STACK.append(tempfile.tempdir)
Expand Down

0 comments on commit 780cbe1

Please sign in to comment.