File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 11
11
#include < Python.h>
12
12
#include " ttconv/pprdrv.h"
13
13
#include < vector>
14
+ #include < cassert>
14
15
15
16
class PythonExceptionOccurred
16
17
{
@@ -185,14 +186,17 @@ class PythonDictionaryCallback : public TTDictionaryCallback
185
186
186
187
virtual void add_pair (const char * a, const char * b)
187
188
{
189
+ assert (a != NULL );
190
+ assert (b != NULL );
188
191
PyObject* value = PyBytes_FromString (b);
189
- if (value)
192
+ if (! value)
190
193
{
191
- if (PyDict_SetItemString (_dict, a, value))
192
- {
193
- Py_DECREF (value);
194
- throw PythonExceptionOccurred ();
195
- }
194
+ throw PythonExceptionOccurred ();
195
+ }
196
+ if (PyDict_SetItemString (_dict, a, value))
197
+ {
198
+ Py_DECREF (value);
199
+ throw PythonExceptionOccurred ();
196
200
}
197
201
Py_DECREF (value);
198
202
}
You can’t perform that action at this time.
0 commit comments