Add more robustness - use PyString_CheckExact(pvalue) to check whether pvalue is a Python string before

calling PyString_AsString(pvalue).  Similar to http://llvm.org/viewvc/llvm-project?rev=146584&view=rev.

llvm-svn: 146606
This commit is contained in:
Johnny Chen 2011-12-14 23:27:53 +00:00
parent a8aa30b620
commit a2b514a3f2
1 changed files with 1 additions and 1 deletions

View File

@ -234,7 +234,7 @@ LLDBSwigPythonCallTypeScript
if (pvalue != NULL)
{
if (pvalue != Py_None)
if (pvalue != Py_None && PyString_CheckExact(pvalue))
retval = std::string(PyString_AsString(pvalue));
else
retval = "None";