]> arthur.barton.de Git - bup.git/blobdiff - cmd/daemon-cmd.py
web: add missing chunkyreader import
[bup.git] / cmd / daemon-cmd.py
index c90e3e4bb3b9224c3be2039a7760340e28c1c9e8..8386fc0e120983252da06dbfe80c8b79a98c4ddb 100755 (executable)
@@ -1,4 +1,9 @@
-#!/usr/bin/env python
+#!/bin/sh
+"""": # -*-python-*-
+bup_python="$(dirname "$0")/bup-python" || exit $?
+exec "$bup_python" "$0" ${1+"$@"}
+"""
+# end of bup preamble
 import sys, getopt, socket, subprocess, fcntl
 from bup import options, path
 from bup.helpers import *
@@ -25,7 +30,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:
@@ -36,7 +41,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)