[Python 3 compability] decode function used in 'needsQuoting' function

is not available on Python 3.
This commit is contained in:
Murtuza Zabuawala 2016-01-04 17:08:48 +05:30 committed by Ashesh Vashi
parent eed1590a51
commit b309b1ffb8

View File

@ -797,8 +797,12 @@ class Driver(BaseDriver):
@staticmethod @staticmethod
def needsQuoting(key, forTypes): def needsQuoting(key, forTypes):
# Python 3 does not require the decoding of value
if hasattr(str, 'decode'):
value = key.decode() value = key.decode()
valNoArray = value.decode() else:
value = key
valNoArray = value
# check if the string is number or not # check if the string is number or not
if (isinstance(value, int)): if (isinstance(value, int)):