Python 3.9
print "get remote configure failed: %s, %s" % (REMOTE_JSON_FILE, e.message)
SyntaxError: invalid syntax
def GetClangConfigFromRemote():
global g_clang_format_config
res = None
try:
res = urllib.request.urlopen(REMOTE_JSON_FILE, timeout=3.0)
except Exception as e:
print "get remote configure failed: %s, %s" % (REMOTE_JSON_FILE, e.message)
print "use local default config instead"
g_clang_format_config = DEFAULT_CONFIG
return True
jsonDict = None
try:
jsonDict = json.loads(res.read())
except Exception as e:
print "parse json failed:%s" % e.message
print "use local default config instead"
g_clang_format_config = DEFAULT_CONFIG
return True
g_clang_format_config = jsonDict["C_Cpp.clang_format_style"]
return True
运行结果及报错内容
print "get remote configure failed: %s, %s" % (REMOTE_JSON_FILE, e.message)
^
SyntaxError: invalid syntax