ART: Change Python code in run-test

We rely on Python's os.path.realpath as the "nuclear option" to
resolve the temp directory. However, between Python 2 and Python 3,
it is better not to use print.

Bug: 140161314
Test: art/test/testrunner/testrunner.py -b --host -t 001-HelloWorld
Change-Id: I38ad20d63b94e5bf816cb019f9f95cb2934e33dc
diff --git a/test/run-test b/test/run-test
index d7be884..daccd61 100755
--- a/test/run-test
+++ b/test/run-test
@@ -543,7 +543,11 @@
 # Cannot use readlink -m, as it does not exist on Mac.
 # Fallback to nuclear option:
 noncanonical_tmp_dir=$tmp_dir
-tmp_dir="`cd $oldwd ; python -c "import os; print os.path.realpath('$tmp_dir')"`"
+tmp_dir="`cd $oldwd ; python -c "import os; import sys; sys.stdout.write(os.path.realpath('$tmp_dir'))"`"
+if [ -z $tmp_dir ] ; then
+  err_echo "Failed to resolve $tmp_dir"
+  exit 1
+fi
 mkdir -p $tmp_dir
 
 # Add thread suspend timeout flag