Skip to content
This repository has been archived by the owner on Feb 3, 2024. It is now read-only.

Fix for working with python3 (ST3) #216

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions internals/translationunitcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@

from .common import Worker, complete_path, expand_path, get_setting, get_path_setting,\
get_language, LockedVariable, run_in_main_thread, error_message,\
display_user_selection, get_cpu_count, status_message, bencode, bdecode, are_we_there_yet
display_user_selection, get_cpu_count, status_message, bencode, bdecode,\
sencode, sdecode, are_we_there_yet
from .clang import cindex
from .parsehelp.parsehelp import *

Expand Down Expand Up @@ -1251,14 +1252,14 @@ def get_translation_unit(self, filename, opts=[], opts_script=None, unsaved_file

if opts_script:
# shlex.split barfs if fed with an unicode strings
args = shlex.split(opts_script.encode()) + [filename]
args = shlex.split(sencode(opts_script)) + [filename]
process = subprocess.Popen(args, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
output = process.communicate()
if process.returncode:
print("The options_script failed with code [%s]" % process.returncode)
print(output[1])
else:
opts += shlex.split(output[0])
opts += shlex.split(bdecode(output[0]))

if self.debug_options:
print("Will compile file %s with the following options:\n%s" % (filename, opts))
Expand Down