IMPALA-11952 (part 1): Fix except syntax

Python 3 does not support this old except syntax:

except Exception, e:

Instead, it needs to be:

except Exception as e:

This uses impala-futurize to fix all locations of
the old syntax.

Testing:
 - The check-python-syntax.sh no longer shows errors
   for except syntax.

Change-Id: I1737281a61fa159c8d91b7d4eea593177c0bd6c9
Reviewed-on: http://gerrit.cloudera.org:8080/19551
Reviewed-by: Joe McDonnell <joemcdonnell@cloudera.com>
Reviewed-by: Michael Smith <michael.smith@cloudera.com>
Tested-by: Michael Smith <michael.smith@cloudera.com>
This commit is contained in:
Joe McDonnell
2023-02-26 13:12:47 -08:00
parent ff62a4df39
commit c71de994b0
32 changed files with 75 additions and 75 deletions

View File

@@ -84,7 +84,7 @@ def dump_config(d, source_path, out):
if isinstance(v, int):
v = str(v)
v_new = _substitute_env_vars(v)
except KeyError, e:
except KeyError as e:
raise Exception("failed environment variable substitution for value {k}: {e}"
.format(k=k, e=e))
print >>out, """\