File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -1769,21 +1769,12 @@ UnirecTemplate_getDict(pytrap_unirectemplate *self)
17691769static PyObject *
17701770UnirecTemplate_getFieldType (pytrap_unirectemplate * self , PyObject * args )
17711771{
1772- PyObject * name ;
1772+ PyObject * name , * result = NULL ;
17731773
1774- if (!PyArg_ParseTuple (args , "O" , & name )) {
1774+ if (!PyArg_ParseTuple (args , "O!" , & PyUnicode_Type , & name )) {
17751775 return NULL ;
17761776 }
17771777
1778- #if PY_MAJOR_VERSION >= 3
1779- if (!PyUnicode_Check (name ))
1780- #else
1781- if (!PyUnicode_Check (name ) && !PyString_Check (name ))
1782- #endif
1783- {
1784- PyErr_SetString (PyExc_TypeError , "Argument field_name must be string." );
1785- return NULL ;
1786- }
17871778 int32_t field_id = UnirecTemplate_get_field_id (self , name );
17881779
17891780 switch (ur_get_type (field_id )) {
You can’t perform that action at this time.
0 commit comments