Skip to content

Commit

Permalink
handle None as return value for call_pkg_config (fix #8)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Feb 28, 2013
1 parent aad7380 commit 3e166ba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/rospack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,12 @@ Rosstackage::cpp_exports(const std::string& name, const std::string& type,
std::string errmsg = "could not call python function 'rosdep2.rospack.call_pkg_config'";
throw Exception(errmsg);
}
if(pValue == Py_None)
{
Py_DECREF(pValue);
std::string errmsg = "python function 'rosdep2.rospack.call_pkg_config' could not call 'pkg-config'";
throw Exception(errmsg);
}

flags.push_back(std::pair<std::string, bool>(PyString_AsString(pValue), true));
Py_DECREF(pValue);
Expand Down

0 comments on commit 3e166ba

Please sign in to comment.