[Thuban-commits] r2754 - branches/WIP-pyshapelib-bramz/libraries/pyshapelib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Apr 11 21:04:12 CEST 2007


Author: bramz
Date: 2007-04-11 21:04:12 +0200 (Wed, 11 Apr 2007)
New Revision: 2754

Modified:
   branches/WIP-pyshapelib-bramz/libraries/pyshapelib/dbflibmodule.c
Log:
Bug fix: in dbffile_add_field, the exception must be cleared if the first PyArg_ParseTuple fails.

Modified: branches/WIP-pyshapelib-bramz/libraries/pyshapelib/dbflibmodule.c
===================================================================
--- branches/WIP-pyshapelib-bramz/libraries/pyshapelib/dbflibmodule.c	2007-04-11 18:57:04 UTC (rev 2753)
+++ branches/WIP-pyshapelib-bramz/libraries/pyshapelib/dbflibmodule.c	2007-04-11 19:04:12 UTC (rev 2754)
@@ -222,8 +222,11 @@
 	int type, width, decimals;
 	int field;
 	
-	if (!PyArg_ParseTuple(args, "Uiii:add_field", &oname, &type, &width, &decimals)
-		&& !PyArg_ParseTuple(args, "Siii:add_field", &oname, &type, &width, &decimals)) return NULL;
+	if (!PyArg_ParseTuple(args, "Uiii:add_field", &oname, &type, &width, &decimals))
+	{
+		PyErr_Clear();
+		if (!PyArg_ParseTuple(args, "Siii:add_field", &oname, &type, &width, &decimals)) return NULL;
+	}
 	
 	name = encode_string(self->handle, oname);
 	if (!name) return NULL;



More information about the Thuban-commits mailing list