diff options
author | Sean Silva <silvas@purdue.edu> | 2013-11-08 22:46:56 +0000 |
---|---|---|
committer | Sean Silva <silvas@purdue.edu> | 2013-11-08 22:46:56 +0000 |
commit | fbb091aa6319a52ae6790ed776ffd03ed2d107b5 (patch) | |
tree | b0a72e5f08174b8a7dd00234aa0bd0aad2a3fa45 /tools | |
parent | 3a306f96804fd02c00acc51b6a77fdbec9ca44f6 (diff) | |
download | clang-fbb091aa6319a52ae6790ed776ffd03ed2d107b5.tar.gz clang-fbb091aa6319a52ae6790ed776ffd03ed2d107b5.tar.bz2 clang-fbb091aa6319a52ae6790ed776ffd03ed2d107b5.tar.xz |
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!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194287 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/clang-format/clang-format-sublime.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/clang-format/clang-format-sublime.py b/tools/clang-format/clang-format-sublime.py index 2099d7a98c..16ff56e502 100644 --- a/tools/clang-format/clang-format-sublime.py +++ b/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)) |