From 6f708314978187243424be89f4f6c0a1d14cb338 Mon Sep 17 00:00:00 2001 From: Trevor Bramwell Date: Thu, 22 Mar 2018 13:40:22 -0700 Subject: Fix Python3 Errors for Release Automation My testing was done using Python 2.7 but the build server running the jobs is obviously running Python3. These changes allow the create_branch.py release script to run against both Python2 and Python3. Change-Id: I02478986ef869ce82ece5b96dbb4b5ed548a2a55 Signed-off-by: Trevor Bramwell --- releases/scripts/create_branch.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'releases/scripts') diff --git a/releases/scripts/create_branch.py b/releases/scripts/create_branch.py index 8de130972..362aaaf99 100644 --- a/releases/scripts/create_branch.py +++ b/releases/scripts/create_branch.py @@ -12,7 +12,12 @@ Create Gerrit Branchs """ import argparse -import ConfigParser + +try: + import ConfigParser +except ImportError: + import configparser as ConfigParser + import logging import os import yaml @@ -105,7 +110,7 @@ def main(): try: auth = GerritAuth(url=gerrit_url) - except ValueError, err: + except ValueError as err: logging.error("%s for %s", err, gerrit_url) quit(1) restapi = GerritRestAPI(url=gerrit_url, auth=auth) -- cgit 1.2.3-korg