Commits

Aron Griffis committed b60d930

Remove the trap from virtualenvwrapper_tempfile; the function is called in
a command substitution, so the trap fires immediately to remove the file.
There are ways to accomplish this, but they're complex and the caller is
already explicitly rm'ing the file.

diff --git a/virtualenvwrapper.sh b/virtualenvwrapper.sh
--- a/virtualenvwrapper.sh
+++ b/virtualenvwrapper.sh
@@ -130,25 +130,24 @@ function virtualenvwrapper_verify_workon
function virtualenvwrapper_tempfile {

  • Participants
  • Parent commits 92d2655

Comments (0)

Files changed (2)

File tests/test_tempfile.sh

 test_tempfile () {
     filename=$(virtualenvwrapper_tempfile hook)
     assertTrue "Filename is empty" "[ ! -z \"$filename\" ]"
+    assertTrue "File doesn't exist" "[ -f \"$filename\" ]"
     rm -f $filename
     comparable_tmpdir=$(echo $tmplocation | sed 's|/$||')
     comparable_dirname=$(dirname $filename | sed 's|/$||')

File virtualenvwrapper.sh

         echo "ERROR: virtualenvwrapper could not create a temporary file name." 1>&2
         return 1
     fi
-    trap "\rm -f '$file' >/dev/null 2>&1" EXIT
     echo $file
     return 0
 }