From a5be53f9c809009e67f217c00b8f30246aacc237 Mon Sep 17 00:00:00 2001 From: Sarah Owens Date: Sun, 9 Sep 2012 15:37:57 -0700 Subject: Use modern Python exception syntax "except Exception as e" instead of "except Exception, e" This is part of a transition to supporting Python 3. Python >= 2.6 support "as" syntax. Note: this removes Python 2.5 support. Change-Id: I309599f3981bba2b46111c43102bee38ff132803 --- subcmds/upload.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'subcmds/upload.py') diff --git a/subcmds/upload.py b/subcmds/upload.py index 685e3420..84a5e440 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py @@ -329,7 +329,7 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ branch.UploadForReview(people, auto_topic=opt.auto_topic, draft=opt.draft) branch.uploaded = True - except UploadError, e: + except UploadError as e: branch.error = e branch.uploaded = False have_errors = True @@ -384,7 +384,7 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ pending_proj_names = [project.name for (project, avail) in pending] try: hook.Run(opt.allow_all_hooks, project_list=pending_proj_names) - except HookError, e: + except HookError as e: print >>sys.stderr, "ERROR: %s" % str(e) return -- cgit v1.2.3-54-g00ecf