diff --git a/gensim/test/test_fasttext.py b/gensim/test/test_fasttext.py index 1420e8231f..0c1cd0b4b7 100644 --- a/gensim/test/test_fasttext.py +++ b/gensim/test/test_fasttext.py @@ -1448,14 +1448,12 @@ def _conv_line_to_array(line): def _read_wordvectors_using_fasttext(fasttext_fname, words): - cmd = FT_CMD + " print-word-vectors " + fasttext_fname + cmd = [FT_CMD, "print-word-vectors", fasttext_fname] process = subprocess.Popen( cmd, stdin=subprocess.PIPE, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - shell=True) + stdout=subprocess.PIPE) words_str = '\n'.join(words) - out, err = process.communicate(input=words_str.encode("utf-8")) + out, _ = process.communicate(input=words_str.encode("utf-8")) return _parse_wordvectors(out.decode("utf-8"))