X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Ftransitions.py;h=9d21a562ce68db8d548dc09ad0e0fc7fb71838f0;hb=27e00376e81d1c37ff327ee0d39670b266418869;hp=e2461ad2ef56b82ee0cb19bc7fdb7e14f106dcce;hpb=e956742235d6272e38424dc0c89b883153e776b7;p=dak.git diff --git a/dak/transitions.py b/dak/transitions.py index e2461ad2..9d21a562 100755 --- a/dak/transitions.py +++ b/dak/transitions.py @@ -135,7 +135,7 @@ def load_transitions(trans_file): failure = False try: trans = yaml.load(sourcecontent) - except yaml.YAMLError, exc: + except yaml.YAMLError as exc: # Someone fucked it up print "ERROR: %s" % (exc) return None @@ -225,7 +225,7 @@ def lock_file(f): try: fcntl.lockf(lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB) return lock_fd - except OSError, e: + except OSError as e: if errno.errorcode[e.errno] == 'EACCES' or errno.errorcode[e.errno] == 'EEXIST': print "Unable to get lock for %s (try %d of 10)" % \ (file, retry+1) @@ -589,7 +589,7 @@ def main(): if Options["import"]: try: write_transitions_from_file(Options["import"]) - except TransitionsError, m: + except TransitionsError as m: print m sys.exit(2) sys.exit(0)