Index: third_party/closure_compiler/compile_modules.py |
diff --git a/third_party/closure_compiler/compile_modules.py b/third_party/closure_compiler/compile_modules.py |
index e661cc0b3ffb42674e9d2ca9eca64546bdb8434a..b05d5e87edfaa4c024eebbea59e66016ff803a76 100755 |
--- a/third_party/closure_compiler/compile_modules.py |
+++ b/third_party/closure_compiler/compile_modules.py |
@@ -4,13 +4,9 @@ |
# found in the LICENSE file. |
import argparse |
+import ast |
from checker import Checker as Checker |
import os |
-try: |
- import json |
-except: |
- import simplejson as json |
- |
class Module(object): |
@@ -50,12 +46,12 @@ class ModuleParser(object): |
return self._cache[file_path] |
file = open(file_path, "r") |
- data = json.load(file) |
+ file_content = file.read() |
Dan Beam
2014/07/24 18:34:42
nit: file_contents = open(file_path, "r").read()
Vitaly Pavlenko
2014/07/25 22:09:22
I think that's better:
with open(file_path) as fil
|
+ data = ast.literal_eval(file_content) |
file.close() |
if self._verbose: |
- pretty_json = json.dumps(data, indent=2, separators=(',', ': ')).strip() |
- print "(INFO) Layout: " + os.linesep + pretty_json + os.linesep |
+ print "(INFO) Layout: " + os.linesep + file_content + os.linesep |
self._cache[file_path] = [Module.from_dict(m) for m in data] |
return self._cache[file_path] |