Source

pypy / pypy / module / cpyext / patches / mysqldb.patch

*** _mysql-orig.c	2009-03-30 18:59:28.000000000 -0400
--- _mysql.c	2010-05-13 20:10:19.000000000 -0400
***************
*** 413,418 ****
--- 413,419 ----
  					PyObject *pmask=NULL;
  					pmask = PyTuple_GET_ITEM(t, 0);
  					fun2 = PyTuple_GET_ITEM(t, 1);
+ 					Py_XINCREF(fun2);
  					if (PyInt_Check(pmask)) {
  						mask = PyInt_AS_LONG(pmask);
  						if (mask & fields[i].flags) {
***************
*** 430,437 ****
  			  cleanup:
  				Py_DECREF(t);
  			}
! 			if (!fun2) fun2 = Py_None;
! 			Py_INCREF(fun2);
  			Py_DECREF(fun);
  			fun = fun2;
  		}
--- 431,440 ----
  			  cleanup:
  				Py_DECREF(t);
  			}
! 			if (!fun2) {
! 			    fun2 = Py_None;
!     			Py_INCREF(fun2);
! 			}
  			Py_DECREF(fun);
  			fun = fun2;
  		}
***************
*** 1053,1059 ****
--- 1056,1064 ----
  				"no default type converter defined");
  		goto error;
  	}
+     Py_INCREF(d);
  	quoted = PyObject_CallFunction(itemconv, "OO", item, d);
+     Py_DECREF(d);
  	Py_DECREF(itemconv);
  error:
  	return quoted;
***************
*** 2785,2790 ****
--- 2790,2798 ----
  	if (!(e = PyDict_GetItemString(edict, name)))
  		return NULL;
  	if (PyDict_SetItemString(dict, name, e)) return NULL;
+ #ifdef PYPY_VERSION
+     Py_INCREF(e);
+ #endif
  	return e;
  }
  
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.