* Assign a val to local variable `scalar` before returning
* Compare bytes of two values
Long:
1) There are two cases where we get an exception UnboundLocalError: local variable 'scalar' referenced before assignment
We find the type to be boolean and find the value not being true or false (Happens when we compare bytes with a string) and we reach the return statement and we get the above exception since we haven't defined scalar in the outer scope.
When the scalar_type is ResultSetScalarTypes.PROPERTY_UNKNOWN, we reach the final statement and return scalar which hasn't been defined.
2) We have to compare byte response with byte string as b'true' is not equal to true, we always return the boolean values as None since we have reached the else statement.
Short:
1st commit solves local variable 'UnboundLocalError: scalar' referenced before assignment by assigning a value to the variable.
2nd commit compares byte values and returns the appropriate values instead of None.
Squashed Commit:
Long: 1) There are two cases where we get an exception
UnboundLocalError: local variable 'scalar' referenced before assignment
boolean
and find the value not beingtrue
orfalse
(Happens when we compare bytes with a string) and we reach the return statement and we get the above exception since we haven't definedscalar
in the outer scope.scalar_type
isResultSetScalarTypes.PROPERTY_UNKNOWN
, we reach the final statement and returnscalar
which hasn't been defined. 2) We have to compare byte response with byte string asb'true'
is not equal totrue
, we always return the boolean values asNone
since we have reached theelse
statement.Short:
local variable 'UnboundLocalError: scalar' referenced before assignment
by assigning a value to the variable.