[Bf-blender-cvs] [9415976] master: Change exception syntax to be more modern and hopefully fix buildbot issue in the process

Martijn Berger noreply at git.blender.org
Mon Jan 26 08:51:06 CET 2015


Commit: 9415976d1785cd615f7585d3e4343a5474b8fe2e
Author: Martijn Berger
Date:   Mon Jan 26 08:48:55 2015 +0100
Branches: master
https://developer.blender.org/rB9415976d1785cd615f7585d3e4343a5474b8fe2e

Change exception syntax to be more modern and hopefully fix buildbot issue in the process

===================================================================

M	build_files/buildbot/master_unpack.py
M	build_files/buildbot/slave_pack.py

===================================================================

diff --git a/build_files/buildbot/master_unpack.py b/build_files/buildbot/master_unpack.py
index f7ed2d0..56ab80d 100644
--- a/build_files/buildbot/master_unpack.py
+++ b/build_files/buildbot/master_unpack.py
@@ -93,7 +93,7 @@ if not os.path.exists(filename):
 
 try:
     z = zipfile.ZipFile(filename, "r")
-except Exception, ex:
+except Exception as ex:
     sys.stderr.write('Failed to open zip file: %s\n' % str(ex))
     sys.exit(1)
 
@@ -129,7 +129,7 @@ try:
 
     zf.close()
     z.close()
-except Exception, ex:
+except Exception as ex:
     sys.stderr.write('Failed to unzip package: %s\n' % str(ex))
     sys.exit(1)
 
@@ -139,6 +139,6 @@ try:
         if get_platform(f) == platform and get_branch(f) == branch:
             if f != packagename:
                 os.remove(os.path.join(directory, f))
-except Exception, ex:
+except Exception as ex:
     sys.stderr.write('Failed to remove old packages: %s\n' % str(ex))
     sys.exit(1)
diff --git a/build_files/buildbot/slave_pack.py b/build_files/buildbot/slave_pack.py
index 8ff7783..8959e0e 100644
--- a/build_files/buildbot/slave_pack.py
+++ b/build_files/buildbot/slave_pack.py
@@ -133,7 +133,7 @@ else:
             z.write("{}.zip".format(builder))
             z.close()
             sys.exit(retcode)
-        except Exception, ex:
+        except Exception as ex:
             sys.stderr.write('Create buildbot_upload.zip failed' + str(ex) + '\n')
             sys.exit(1)
 
@@ -149,7 +149,7 @@ if os.path.exists(release_dir):
 # create release package
 try:
     subprocess.call(['make', 'package_archive'])
-except Exception, ex:
+except Exception as ex:
     sys.stderr.write('Make package release failed' + str(ex) + '\n')
     sys.exit(1)
 
@@ -180,6 +180,6 @@ try:
     z = zipfile.ZipFile(upload_zip, "w", compression=zipfile.ZIP_STORED)
     z.write(filepath, arcname=file)
     z.close()
-except Exception, ex:
+except Exception as ex:
     sys.stderr.write('Create buildbot_upload.zip failed' + str(ex) + '\n')
     sys.exit(1)




More information about the Bf-blender-cvs mailing list