Skip to content

Commit

Permalink
[SPARK-3867] ./python/run-tests failed when it run with Python 2.6 an…
Browse files Browse the repository at this point in the history
…d unittest2 is not installed
  • Loading branch information
cocoatomo committed Oct 11, 2014
1 parent 1d72a30 commit f068eb5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion python/pyspark/mllib/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
from numpy import array, array_equal

if sys.version_info[:2] <= (2, 6):
import unittest2 as unittest
try:
import unittest2 as unittest
except ImportError:
sys.stderr.write('Please install unittest2 to test with Python 2.6 or earlier')
sys.exit(1)
else:
import unittest

Expand Down
6 changes: 5 additions & 1 deletion python/pyspark/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@
from platform import python_implementation

if sys.version_info[:2] <= (2, 6):
import unittest2 as unittest
try:
import unittest2 as unittest
except ImportError:
sys.stderr.write('Please install unittest2 to test with Python 2.6 or earlier')
sys.exit(1)
else:
import unittest

Expand Down

0 comments on commit f068eb5

Please sign in to comment.