X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fprocess_upload.py;h=4d9f3b00b768071363bd9ac74c72cefe19de7e74;hb=fb6b2db21c6a2e8d73e4c538e012f139b63f3f2a;hp=84186c57186a792a7a3e66bd59fd3d864474f05f;hpb=af72c901d49515105812b8ef46ce98b55d4072ba;p=dak.git diff --git a/dak/process_upload.py b/dak/process_upload.py index 84186c57..4d9f3b00 100755 --- a/dak/process_upload.py +++ b/dak/process_upload.py @@ -229,7 +229,7 @@ def action(u, session): try: chg = session.query(DBChange).filter_by(changesname=os.path.basename(u.pkg.changes_file)).one() - except NoResultFound, e: + except NoResultFound as e: chg = None if len(u.rejects) > 0: @@ -364,7 +364,7 @@ def process_it(changes_file, session): # If this is the Real Thing(tm), copy things into a private # holding directory first to avoid replacable file races. if not Options["No-Action"]: - os.chdir(cnf["Dir::Queue::Holding"]) + holding.chdir_to_holding() # Absolutize the filename to avoid the requirement of being in the # same directory as the .changes file. @@ -458,7 +458,7 @@ def main(): lock_fd = os.open(os.path.join(cnf["Dir::Lock"], 'dinstall.lock'), os.O_RDWR | os.O_CREAT) try: fcntl.lockf(lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB) - except IOError, e: + except IOError as e: if errno.errorcode[e.errno] == 'EACCES' or errno.errorcode[e.errno] == 'EAGAIN': utils.fubar("Couldn't obtain lock; assuming another 'dak process-upload' is already running.") else: