[Lldb-commits] [lldb] r146606 - /lldb/trunk/scripts/Python/python-wrapper.swig
Johnny Chen
johnny.chen at apple.com
Wed Dec 14 15:27:54 PST 2011
Author: johnny
Date: Wed Dec 14 17:27:53 2011
New Revision: 146606
URL: http://llvm.org/viewvc/llvm-project?rev=146606&view=rev
Log:
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.
Modified:
lldb/trunk/scripts/Python/python-wrapper.swig
Modified: lldb/trunk/scripts/Python/python-wrapper.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/python-wrapper.swig?rev=146606&r1=146605&r2=146606&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/python-wrapper.swig (original)
+++ lldb/trunk/scripts/Python/python-wrapper.swig Wed Dec 14 17:27:53 2011
@@ -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";
More information about the lldb-commits
mailing list