aboutsummaryrefslogtreecommitdiff
path: root/clang/tools
diff options
context:
space:
mode:
authorSean Silva <silvas@purdue.edu>2013-11-08 22:46:56 +0000
committerSean Silva <silvas@purdue.edu>2013-11-08 22:46:56 +0000
commit60dccf2d0622803c4e3ed985517775d9112c8304 (patch)
tree4d07c314af1ce8995b75ed2b77859687ab4655b6 /clang/tools
parent71f87cb33a2f4bab49e8c5150a9ccc0d7844c306 (diff)
downloadllvm-60dccf2d0622803c4e3ed985517775d9112c8304.zip
llvm-60dccf2d0622803c4e3ed985517775d9112c8304.tar.gz
llvm-60dccf2d0622803c4e3ed985517775d9112c8304.tar.bz2
Py3k compat for clang-format Sublime Text extension.
Sublime Text 2 uses Python 2.6 Sublime Text 3 uses Python 3.3 The `print` function has been available as a __future__ import since 2.6, so use it. Patch by Johan Engelen! llvm-svn: 194287
Diffstat (limited to 'clang/tools')
-rw-r--r--clang/tools/clang-format/clang-format-sublime.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/tools/clang-format/clang-format-sublime.py b/clang/tools/clang-format/clang-format-sublime.py
index 2099d7a..16ff56e 100644
--- a/clang/tools/clang-format/clang-format-sublime.py
+++ b/clang/tools/clang-format/clang-format-sublime.py
@@ -12,6 +12,7 @@
# It operates on the current, potentially unsaved buffer and does not create
# or save any files. To revert a formatting, just undo.
+from __future__ import print_function
import sublime
import sublime_plugin
import subprocess
@@ -45,7 +46,7 @@ class ClangFormatCommand(sublime_plugin.TextCommand):
stderr=subprocess.PIPE, stdin=subprocess.PIPE)
output, error = p.communicate(buf.encode(encoding))
if error:
- print error
+ print(error)
self.view.replace(
edit, sublime.Region(0, self.view.size()),
output.decode(encoding))