mirror of
https://github.com/apache/impala.git
synced 2025-12-19 18:12:08 -05:00
IMPALA-11976: Fix use of deprecated functions/fields removed in Python 3
Python 3 moved several things around or removed deprecated functions / fields: - sys.maxint was removed, but sys.maxsize provides similar functionality - long was removed, but int provides the same range - file() was removed, but open() already provided the same functionality - Exception.message was removed, but str(exception) is equivalent - Some encodings (like hex) were moved to codecs.encode() - string.letters -> string.ascii_letters - string.lowercase -> string.ascii_lowercase - string.strip was removed This fixes all of those locations. Python 3 also has slightly different rounding behavior from round(), so this changes round() to use future's builtins.round() to get the Python 3 behavior. This fixes the following pylint warnings: - file-builtin - long-builtin - invalid-str-codec - round-builtin - deprecated-string-function - sys-max-int - exception-message-attribute Testing: - Ran cores tests Change-Id: I094cd7fd06b0d417fc875add401d18c90d7a792f Reviewed-on: http://gerrit.cloudera.org:8080/19591 Reviewed-by: Joe McDonnell <joemcdonnell@cloudera.com> Tested-by: Joe McDonnell <joemcdonnell@cloudera.com>
This commit is contained in:
@@ -626,7 +626,7 @@ class TestImpalaShellInteractive(ImpalaTestSuite):
|
||||
self._expect_with_cmd(child_proc, "select 'hi'", vector, ('hi'))
|
||||
child_proc.sendline('exit;')
|
||||
child_proc.expect(pexpect.EOF)
|
||||
history_contents = file(new_hist.name).read()
|
||||
history_contents = open(new_hist.name).read()
|
||||
assert "select 'hi'" in history_contents
|
||||
|
||||
def test_rerun(self, vector, tmp_history_file):
|
||||
|
||||
Reference in New Issue
Block a user