Fix Python code generator to correctly escape strings

A string that contained escape symbols was not correctly escaped
when generating the Python code for the selection.

This could cause selection operations to fail to compile.
master
Salvo 'LtWorf' Tomaselli 2016-04-23 15:19:32 +07:00
parent 92990039ac
commit 722b164d56
2 changed files with 2 additions and 1 deletions

@ -3,6 +3,7 @@
- Changes to make failures in commutative operators commutative too - Changes to make failures in commutative operators commutative too
- Added new optimization to remove useless joins - Added new optimization to remove useless joins
- Correct optimization over selection and product - Correct optimization over selection and product
- Fix Python code generator to correctly escape strings
2.4 2.4
- Improve error reporting - Improve error reporting

@ -194,7 +194,7 @@ class Node (object):
prop = '{\"%s\"}' % prop.replace( prop = '{\"%s\"}' % prop.replace(
',', '\",\"').replace(ARROW, '\":\"').replace(' ', '') ',', '\",\"').replace(ARROW, '\":\"').replace(' ', '')
else: # Selection else: # Selection
prop = '\"%s\"' % prop prop = repr(prop)
return '%s.%s(%s)' % (self.child.toPython(), op_functions[self.name], prop) return '%s.%s(%s)' % (self.child.toPython(), op_functions[self.name], prop)
return self.name return self.name