Skip to content
Snippets Groups Projects
Commit aa78925f authored by Enric Tejedor Saavedra's avatar Enric Tejedor Saavedra
Browse files

[Exp PyROOT] Convert to Python str to use its methods

When iterating over a std::vector<std::string>, new cppyy returns
std::strings. If we want to use Python str features like strip
or sorted, we need to convert the std::strings to Python strs.
parent 7a0b6675
No related branches found
No related tags found
No related merge requests found
...@@ -133,7 +133,7 @@ class CppCompleter(object): ...@@ -133,7 +133,7 @@ class CppCompleter(object):
def _completeImpl(self, line): def _completeImpl(self, line):
line=line.split()[-1] line=line.split()[-1]
suggestions = self._getSuggestions(line) suggestions = [ str(s) for s in self._getSuggestions(line) ]
suggestions = filter(lambda s: len(s.strip()) != 0, suggestions) suggestions = filter(lambda s: len(s.strip()) != 0, suggestions)
suggestions = sorted(suggestions) suggestions = sorted(suggestions)
if not suggestions: return [] if not suggestions: return []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment