summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test_which.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/test_which.py b/tests/test_which.py
index 15a8944..631db5a 100644
--- a/tests/test_which.py
+++ b/tests/test_which.py
@@ -2,6 +2,7 @@
import subprocess
import tempfile
import shutil
+import sys
import errno
import os
@@ -41,8 +42,12 @@ class TestCaseWhich(PexpectTestCase.PexpectTestCase):
" which() finds an executable in $PATH and returns its abspath. "
bin_dir = tempfile.mkdtemp()
+ if sys.getfilesystemencoding() == 'ascii':
+ prefix = 'ascii-'
+ else:
+ prefix = u'ǝpoɔıun-'
temp_obj = tempfile.NamedTemporaryFile(
- suffix=u'.sh', prefix=u'ǝpoɔıun-',
+ suffix=u'.sh', prefix=prefix,
dir=bin_dir, delete=False)
bin_path = temp_obj.name
fname = os.path.basename(temp_obj.name)