From a2b514a3f2f6a9eeffbaf8d23351726ab11e8d96 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Wed, 14 Dec 2011 23:27:53 +0000 Subject: [PATCH] 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 --- lldb/scripts/Python/python-wrapper.swig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/scripts/Python/python-wrapper.swig b/lldb/scripts/Python/python-wrapper.swig index 787074e7fcb8..f6e3afd4c395 100644 --- a/lldb/scripts/Python/python-wrapper.swig +++ b/lldb/scripts/Python/python-wrapper.swig @@ -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";