tests/run-tests.py
changeset 4321 99184c6fd88f
parent 4320 f9b61e0fc929
child 4365 46280c004f22
--- a/tests/run-tests.py	Sat Apr 07 04:27:55 2007 -0300
+++ b/tests/run-tests.py	Sat Apr 07 04:27:55 2007 -0300
@@ -240,9 +240,15 @@
     os.mkdir(tmpd)
     os.chdir(tmpd)
 
+    try:
+        tf = open(testpath)
+        firstline = tf.readline().rstrip()
+        tf.close()
+    except:
+        firstline = ''
     lctest = test.lower()
 
-    if lctest.endswith('.py'):
+    if lctest.endswith('.py') or firstline == '#!/usr/bin/env python':
         cmd = '%s "%s"' % (python, testpath)
     elif lctest.endswith('.bat'):
         # do not run batch scripts on non-windows