def set_syntax(view, syntax):
"""Attempts to set syntax for view without showing error pop-up.
"""
try:
sublime.load_resource(syntax)
except:
return False
else:
view.set_syntax_file(syntax)
return True