X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fdaemon-cmd.py;h=ba4b86a50f8917bf697e2a45864cfecb8ddb97ba;hb=093752b42c5548028c6f84c67f7741b2321c512f;hp=5149c1602bb166640baee39506e29abf29867f26;hpb=7e0fcaa5b28eb1aa022a59e5056679e7854070b9;p=bup.git diff --git a/cmd/daemon-cmd.py b/cmd/daemon-cmd.py index 5149c16..ba4b86a 100755 --- a/cmd/daemon-cmd.py +++ b/cmd/daemon-cmd.py @@ -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)