projects
/
gc-dialer
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
51c5307
)
Protecting against some javascript comments within the json
author
Ed Page
<eopage@byu.net>
Tue, 19 Oct 2010 23:19:57 +0000
(18:19 -0500)
committer
Ed Page
<eopage@byu.net>
Tue, 19 Oct 2010 23:19:57 +0000
(18:19 -0500)
src/backends/gvoice.py
patch
|
blob
|
history
diff --git
a/src/backends/gvoice.py
b/src/backends/gvoice.py
index
376f366
..
a63eabe
100755
(executable)
--- a/
src/backends/gvoice.py
+++ b/
src/backends/gvoice.py
@@
-792,13
+792,16
@@
def itergroup(iterator, count, padValue = None):
def safe_eval(s):
_TRUE_REGEX = re.compile("true")
_FALSE_REGEX = re.compile("false")
+ _COMMENT_REGEX = re.compile("^\s+//.*$", re.M)
s = _TRUE_REGEX.sub("True", s)
s = _FALSE_REGEX.sub("False", s)
+ s = _COMMENT_REGEX.sub("#", s)
try:
results = eval(s, {}, {})
except SyntaxError:
_moduleLogger.exception("Oops")
- return None
+ results = None
+ return results
def _fake_parse_json(flattened):