Removing redundant piece of code

This commit is contained in:
stamparm 2013-02-25 14:12:57 +01:00
parent dc9dc233b6
commit 9d81be7af5

View File

@ -19,9 +19,9 @@ class Syntax(GenericSyntax):
def escaper(value): def escaper(value):
retVal = None retVal = None
try: try:
retVal = "0x%s" % binascii.hexlify(value.strip("'")) retVal = "0x%s" % binascii.hexlify(value)
except UnicodeEncodeError: except UnicodeEncodeError:
retVal = "CONVERT(0x%s USING utf8)" % "".join("%.2x" % ord(_) for _ in utf8encode(value.strip("'"))) retVal = "CONVERT(0x%s USING utf8)" % "".join("%.2x" % ord(_) for _ in utf8encode(value))
return retVal return retVal
return Syntax._escape(expression, quote, escaper) return Syntax._escape(expression, quote, escaper)