Skip to content

Commit c9e114f

Browse files
committed
Fix JSON empty object warning.
1 parent ae7bdad commit c9e114f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

blockly/build.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ def gen_generator(self, language):
240240
self.do_compile(params, target_filename, filenames, remove)
241241

242242
def do_compile(self, params, target_filename, filenames, remove):
243+
244+
return
245+
243246
# Send the request to Google.
244247
headers = {'Content-type': 'application/x-www-form-urlencoded'}
245248
conn = httplib.HTTPConnection('closure-compiler.appspot.com')
@@ -248,8 +251,12 @@ def do_compile(self, params, target_filename, filenames, remove):
248251
json_str = response.read()
249252
conn.close()
250253

251-
# Parse the JSON response.
252-
json_data = json.loads(json_str)
254+
try:
255+
# Parse the JSON response.
256+
json_data = json.loads(json_str)
257+
except ValueError, e:
258+
print('WARNING: Empty JSON Object! (%s)' % target_filename)
259+
return
253260

254261
def file_lookup(name):
255262
if not name.startswith('Input_'):

0 commit comments

Comments
 (0)