Skip to content
Snippets Groups Projects
Commit e7613241 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

[Interpreter] Ignore empty command and Python comments.

parent 3204d735
No related branches found
No related tags found
No related merge requests found
...@@ -185,6 +185,13 @@ void Interpreter::python( const std::string& command, std::string& res, ...@@ -185,6 +185,13 @@ void Interpreter::python( const std::string& command, std::string& res,
out = ""; out = "";
err = ""; err = "";
// Check if the command is not a python comment or empty.
std::string::size_type iFirstNonWhite = command.find_first_not_of (" \t");
// Empty command
if (iFirstNonWhite == std::string::npos) return;
// Command is a comment. Ignore it.
if (command[iFirstNonWhite] == '#') return;
PyEval_RestoreThread(_pyState); PyEval_RestoreThread(_pyState);
std::cout << command.c_str() << std::endl; std::cout << command.c_str() << std::endl;
......
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