mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
translator: Add Python 3 support (see issue #2856)
This also fixes incorrect translation of types in capi header comments.
This commit is contained in:
@ -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
|
||||
@ -21,9 +23,9 @@ 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" % (clang_format_exe, file_name), \
|
||||
root_dir, file_contents)
|
||||
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':
|
||||
|
Reference in New Issue
Block a user