From: Alexander Kornienko Date: Thu, 27 Oct 2016 15:15:23 +0000 (+0000) Subject: Attempt to make clang-format.py python 3 - compatible. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=82e00e504e1d42407e8e5df9536dd3614ab69db1;p=clang Attempt to make clang-format.py python 3 - compatible. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285301 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/clang-format/clang-format.py b/tools/clang-format/clang-format.py index 5a5f99b259..aded301781 100644 --- a/tools/clang-format/clang-format.py +++ b/tools/clang-format/clang-format.py @@ -51,7 +51,7 @@ if vim.eval('exists("g:clang_format_fallback_style")') == "1": def main(): # Get the current text. encoding = vim.eval("&encoding") - buf = [ unicode(line, encoding) for line in vim.current.buffer ] + buf = [ line.decode(encoding) for line in vim.current.buffer ] text = '\n'.join(buf) # Determine range to format.