Skip to content
Snippets Groups Projects
Unverified Commit f0333285 authored by Olivier Dony's avatar Olivier Dony
Browse files

[FIX] P3: convert exception handlers to except..as

Those are possibly posterior or leftovers from 3979f680
parent f5b7de0e
No related branches found
No related tags found
No related merge requests found
......@@ -174,7 +174,7 @@ class StockQuant(models.Model):
if quant.quantity == 0 and quant.reserved_quantity == 0:
quant.unlink()
break
except OperationalError, e:
except OperationalError as e:
if e.pgcode == '55P03': # could not obtain the lock
continue
else:
......
......@@ -133,7 +133,7 @@ class OdooDocker(object):
def end(self):
try:
_rpc_count_modules(port=str(self.port))
except Exception, e:
except Exception as e:
print('Exception during docker execution: %s:' % str(e))
print('Error during docker execution: printing the bash output:')
with open(self.log_file.name) as f:
......@@ -152,7 +152,7 @@ def docker(docker_image, build_dir, pub_dir):
_docker.start(docker_image, build_dir, pub_dir)
try:
yield _docker
except Exception, e:
except Exception:
raise
finally:
_docker.end()
......@@ -439,7 +439,7 @@ def main():
if not o.no_testing:
test_tgz(o)
published_files = publish(o, 'tarball', ['tar.gz', 'zip'])
except Exception, e:
except Exception as e:
print("Won't publish the tgz release.\n Exception: %s" % str(e))
if not o.no_debian:
build_deb(o)
......@@ -448,7 +448,7 @@ def main():
test_deb(o)
published_files = publish(o, 'debian', ['deb', 'dsc', 'changes', 'tar.gz'])
gen_deb_package(o, published_files)
except Exception, e:
except Exception as e:
print("Won't publish the deb release.\n Exception: %s" % str(e))
if not o.no_rpm:
build_rpm(o)
......@@ -457,7 +457,7 @@ def main():
test_rpm(o)
published_files = publish(o, 'redhat', ['noarch.rpm'])
gen_rpm_repo(o, published_files[0])
except Exception, e:
except Exception as e:
print("Won't publish the rpm release.\n Exception: %s" % str(e))
if not o.no_windows:
_prepare_build_dir(o, win32=True)
......@@ -466,7 +466,7 @@ def main():
if not o.no_testing:
test_exe(o)
published_files = publish(o, 'windows', ['exe'])
except Exception, e:
except Exception as e:
print("Won't publish the exe release.\n Exception: %s" % str(e))
except:
pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment