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:
@@ -49,8 +49,8 @@ def get_fragment_instances():
|
||||
# No valid thread_debug_info
|
||||
if not tdi:
|
||||
break
|
||||
hi = long(tdi['instance_id_']['hi'])
|
||||
lo = long(tdi['instance_id_']['lo'])
|
||||
hi = int(tdi['instance_id_']['hi'])
|
||||
lo = int(tdi['instance_id_']['lo'])
|
||||
fi = "%lx:%lx" % (hi, lo)
|
||||
if fi != "0:0":
|
||||
fragment_instances[fi.strip('"')].append(thread.num)
|
||||
|
||||
Reference in New Issue
Block a user