s3:winbind: Move winbindd_dual_init_connection() function
[samba.git] / script / bisect-test.py
index cdfc93bdb8afae8556388577b1c6dcff0327003e..7c5cd635f58f033c653196e11f6d2e9b3d811e90 100755 (executable)
@@ -1,11 +1,13 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # use git bisect to work out what commit caused a test failure
 # Copyright Andrew Tridgell 2010
 # released under GNU GPL v3 or later
 
 
 from subprocess import call, check_call, Popen, PIPE
-import os, tempfile, sys
+import os
+import tempfile
+import sys
 from optparse import OptionParser
 
 parser = OptionParser()
@@ -46,7 +48,7 @@ def find_git_root():
     '''get to the top of the git repo'''
     p = os.getcwd()
     while p != '/':
-        if os.path.isdir(os.path.join(p, ".git")):
+        if os.path.exists(os.path.join(p, ".git")):
             return p
         p = os.path.abspath(os.path.join(p, '..'))
     return None
@@ -56,7 +58,7 @@ cwd = os.getcwd()
 gitroot = find_git_root()
 
 # create a bisect script
-f = tempfile.NamedTemporaryFile(delete=False)
+f = tempfile.NamedTemporaryFile(delete=False, mode="w+t")
 f.write("set -x\n")
 f.write("cd %s || exit 125\n" % cwd)
 if opts.autogen: