Attempt to make clang-format.py python 3 - compatible.
authorAlexander Kornienko <alexfh@google.com>
Thu, 27 Oct 2016 15:15:23 +0000 (15:15 +0000)
committerAlexander Kornienko <alexfh@google.com>
Thu, 27 Oct 2016 15:15:23 +0000 (15:15 +0000)
llvm-svn: 285301

clang/tools/clang-format/clang-format.py

index 5a5f99b..aded301 100644 (file)
@@ -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.