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.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146606 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/scripts/Python/python-wrapper.swig b/scripts/Python/python-wrapper.swig
index 787074e..f6e3afd 100644
--- a/scripts/Python/python-wrapper.swig
+++ b/scripts/Python/python-wrapper.swig
@@ -234,7 +234,7 @@
                 
                 if (pvalue != NULL)
                 {
-                    if (pvalue != Py_None)
+                    if (pvalue != Py_None && PyString_CheckExact(pvalue))
                         retval = std::string(PyString_AsString(pvalue));
                     else
                         retval = "None";