diff options
author | Marshall Greenblatt <magreenblatt@gmail.com> | 2020-01-14 15:29:42 +0100 |
---|---|---|
committer | Marshall Greenblatt <magreenblatt@gmail.com> | 2020-01-14 15:29:42 +0100 |
commit | 6d7ad9df13beefa2c7598198060631e9b9b6223b (patch) | |
tree | 8184f62536255c7de09907d7d86f5493e1be1a0d /tools/clang_util.py | |
parent | a70a108f0173e867ca2fb230e21c937975254158 (diff) | |
download | jcef-6d7ad9df13beefa2c7598198060631e9b9b6223b.tar.gz |
Add Python 3 support (CEF issue #2856)
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': |