From f0333285fabeeb00a92639642e79f3c7b1d3784f Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Sat, 19 Aug 2017 01:51:55 +0200 Subject: [FIX] P3: convert exception handlers to except..as Those are possibly posterior or leftovers from 3979f6802eeea275f949d28ddf4c18f84fc0f5aa --- setup/package.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'setup') diff --git a/setup/package.py b/setup/package.py index d7c712aba7e..c3eedeee3e7 100755 --- a/setup/package.py +++ b/setup/package.py @@ -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 -- cgit v1.2.3