]> arthur.barton.de Git - bup.git/blobdiff - cmd/daemon-cmd.py
README: add 0.30.x to CI status table
[bup.git] / cmd / daemon-cmd.py
index 5149c1602bb166640baee39506e29abf29867f26..ba4b86a50f8917bf697e2a45864cfecb8ddb97ba 100755 (executable)
@@ -4,6 +4,8 @@ bup_python="$(dirname "$0")/bup-python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
+
+from __future__ import absolute_import
 import sys, getopt, socket, subprocess, fcntl
 from bup import options, path
 from bup.helpers import *
@@ -30,7 +32,7 @@ for res in socket.getaddrinfo(host, port, socket.AF_UNSPEC,
     af, socktype, proto, canonname, sa = res
     try:
         s = socket.socket(af, socktype, proto)
-    except socket.error, e:
+    except socket.error as e:
         continue
     try:
         if af == socket.AF_INET6:
@@ -41,7 +43,7 @@ for res in socket.getaddrinfo(host, port, socket.AF_UNSPEC,
         s.bind(sa)
         s.listen(1)
         fcntl.fcntl(s.fileno(), fcntl.F_SETFD, fcntl.FD_CLOEXEC)
-    except socket.error, e:
+    except socket.error as e:
         s.close()
         continue
     socks.append(s)