Skip to content

Commit

Permalink
Allow build output to be received as strings or bytes
Browse files Browse the repository at this point in the history
Sublime Text 3 r3153 changed the ExecCommand base class to return data as
decoded strings, rather than bytes that need to be decoded. In order to support
both old and new versions of Sublime Text 3, we must support both of these
APIs.

Longer-term, it's probably a good idea to move away from an ExecCommand
subclass.
  • Loading branch information
sentience committed Mar 24, 2018
1 parent a61a582 commit e9ef161
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion elm_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ def style_output(self, syntax):
self.debug_text = get_string('make.missing_plugin')

def on_data(self, proc, data):
self.buffer += data
# ST3 ExecCommand base class changed from receiving bytes to str
if isinstance(data, str):
self.buffer += data
else:
self.buffer += data.decode(self.encoding)

def on_finished(self, proc):
result_strs = self.buffer.split('\n')
Expand Down
3 changes: 3 additions & 0 deletions messages/0.22.2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
New in Elm Language Support 0.22.2 (Mar 24, 2018)

- Fix: Restore build system compatibility with Sublime Text 3 releases prior to r3153.

0 comments on commit e9ef161

Please sign in to comment.