IMPALA-9721: Fix minor python2/3 syntax regression

A minor syntax error slipped past in a recent patch. In python3, the
syntax for catching exceptions requires the 'as' keyword. This error
was missed in code review.

Until automated python3 testing set up, this kind of error is likely
to repeat. See IMPALA-9724.

Change-Id: I0d36c609a3600c8084efcce0026537227144b27d
Reviewed-on: http://gerrit.cloudera.org:8080/15856
Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>
Tested-by: David Knupp <dknupp@cloudera.com>
(cherry picked from commit 6e0085c220)
This commit is contained in:
David Knupp
2020-05-01 23:51:49 -07:00
committed by stiga-huang
parent 3ba1ea1d9a
commit 812ad40bac

View File

@@ -244,13 +244,13 @@ class ImpalaShell(object, cmd.Cmd):
warning = "WARNING: history_max option malformed %s\n" % options.history_max
print(warning, file=sys.stderr)
self.readline.set_history_length(1000)
except IOError, i:
except IOError as i:
warning = "WARNING: Unable to load command history (disabling impala-shell " \
"command history): %s" % i
print(warning, file=sys.stderr)
# This history file exists but is not readable, disable readline.
self._disable_readline()
except ImportError, i:
except ImportError as i:
warning = "WARNING: Unable to import readline module (disabling impala-shell " \
"command history): %s" % i
print(warning, file=sys.stderr)