forked from qt-creator/qt-creator
Dumper: Fix missing import
Additonally ensure that code path works with Python 2.7+ and 3+. Change-Id: I6c7895eeb830259dc07bb7f64049ae51cb814c7f Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
############################################################################
|
||||
|
||||
import os
|
||||
import codecs
|
||||
import copy
|
||||
import collections
|
||||
import struct
|
||||
@@ -436,7 +437,7 @@ class DumperBase:
|
||||
elif self.currentValue.encoding == 'utf8':
|
||||
value = self.hexdecode(value)
|
||||
elif self.currentValue.encoding == 'utf16':
|
||||
b = bytes.fromhex(value)
|
||||
b = bytes(bytearray.fromhex(value))
|
||||
value = codecs.decode(b, 'utf-16')
|
||||
self.put('"%s"' % value)
|
||||
if self.currentValue.elided:
|
||||
|
Reference in New Issue
Block a user