Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 03e60dc + 3dd16b5 commit eb7fd2aCopy full SHA for eb7fd2a
1 file changed
src/_ttconv.cpp
@@ -11,6 +11,7 @@
11
#include <Python.h>
12
#include "ttconv/pprdrv.h"
13
#include <vector>
14
+#include <cassert>
15
16
class PythonExceptionOccurred
17
{
@@ -185,14 +186,17 @@ class PythonDictionaryCallback : public TTDictionaryCallback
185
186
187
virtual void add_pair(const char* a, const char* b)
188
189
+ assert(a != NULL);
190
+ assert(b != NULL);
191
PyObject* value = PyBytes_FromString(b);
- if (value)
192
+ if (!value)
193
- if (PyDict_SetItemString(_dict, a, value))
- {
- Py_DECREF(value);
194
- throw PythonExceptionOccurred();
195
- }
+ throw PythonExceptionOccurred();
+ }
196
+ if (PyDict_SetItemString(_dict, a, value))
197
+ {
198
+ Py_DECREF(value);
199
200
}
201
Py_DECREF(value);
202
0 commit comments