diff options
Diffstat (limited to 'tools/clang_util.py')
-rw-r--r-- | tools/clang_util.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/clang_util.py b/tools/clang_util.py index 33d30d6..90632d5 100644 --- a/tools/clang_util.py +++ b/tools/clang_util.py @@ -2,6 +2,8 @@ # reserved. Use of this source code is governed by a BSD-style license that # can be found in the LICENSE file +from __future__ import absolute_import +from __future__ import print_function from exec_util import exec_cmd import os import sys @@ -23,11 +25,11 @@ else: def clang_format(file_name, file_contents): # -assume-filename is necessary to find the .clang-format file and determine # the language when specifying contents via stdin. - result = exec_cmd("%s -assume-filename=%s" % \ - (os.path.join(script_dir, clang_format_exe), file_name), \ - root_dir, file_contents) + result = exec_cmd("%s -assume-filename=%s" % + (os.path.join(script_dir, clang_format_exe), + file_name), root_dir, file_contents.encode('utf-8')) if result['err'] != '': - print "clang-format error: %s" % result['err'] + print("clang-format error: %s" % result['err']) if result['out'] != '': output = result['out'] if sys.platform == 'win32': |