forked from OSchip/llvm-project
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
This commit is contained in:
parent
71f87cb33a
commit
60dccf2d06
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue