]> arthur.barton.de Git - bup.git/blobdiff - cmd/on-cmd.py
Use BytesIO instead of StringIO
[bup.git] / cmd / on-cmd.py
index 9d6f683f357c869597bdb45f3ab1d735fb2e1e1b..f76ad3e1e06a71fd07de06db586f1827d92d1a97 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, os, struct, getopt, subprocess, signal
 from subprocess import PIPE
 from bup import options, ssh, path
@@ -58,11 +63,11 @@ try:
                 if sp:
                     sp.wait()
                 break
-            except SigException, e:
+            except SigException as e:
                 log('\nbup on: %s\n' % e)
                 os.kill(p.pid, e.signum)
                 ret = 84
-except SigException, e:
+except SigException as e:
     if ret == 0:
         ret = 99
     log('\nbup on: %s\n' % e)