Clear potential prior error state

This commit is contained in:
Robin Dunn
2017-09-23 19:17:23 -07:00
parent 2864b52ce4
commit c8a82c0601

View File

@@ -32,6 +32,7 @@ static wxString i_Py2wxString(PyObject* source)
#if wxUSE_UNICODE_WCHAR == 0
#error wxString converison can only handle WCHAR wxStrings currently
#endif
PyErr_Clear();
PyObject* uni = source;
if (PyBytes_Check(source)) {
// if it's a string object convert it to unicode first, assumes utf-8
@@ -283,6 +284,8 @@ wxVariant i_wxVariant_in_helper(PyObject* obj)
{
wxVariant value;
PyErr_Clear();
if (PyBytes_Check(obj) || PyUnicode_Check(obj))
value = Py2wxString(obj);