[Python-checkins] CVS: python/dist/src/Objects longobject.c,1.111,1.112

Tim Peters tim_one@users.sourceforge.net
Sun, 04 Nov 2001 15:09:42 -0800


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv13971/python/Objects

Modified Files:
	longobject.c 
Log Message:
long_true_divide():  decref its converted arguments.  test_long_future.py
run in an infinite loop no longer grows.  Thanks to Neal Norwitz for
determining that test leaked!


Index: longobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v
retrieving revision 1.111
retrieving revision 1.112
diff -C2 -d -r1.111 -r1.112
*** longobject.c	2001/10/05 20:51:38	1.111
--- longobject.c	2001/11/04 23:09:40	1.112
***************
*** 1616,1625 ****
  	PyLongObject *a, *b;
  	double ad, bd;
! 	int aexp, bexp;
  
  	CONVERT_BINOP(v, w, &a, &b);
  	ad = _PyLong_AsScaledDouble((PyObject *)a, &aexp);
  	bd = _PyLong_AsScaledDouble((PyObject *)b, &bexp);
! 	if ((ad == -1.0 || bd == -1.0) && PyErr_Occurred())
  		return NULL;
  
--- 1616,1628 ----
  	PyLongObject *a, *b;
  	double ad, bd;
! 	int aexp, bexp, failed;
  
  	CONVERT_BINOP(v, w, &a, &b);
  	ad = _PyLong_AsScaledDouble((PyObject *)a, &aexp);
  	bd = _PyLong_AsScaledDouble((PyObject *)b, &bexp);
! 	failed = (ad == -1.0 || bd == -1.0) && PyErr_Occurred();
! 	Py_DECREF(a);
! 	Py_DECREF(b);
! 	if (failed)
  		return NULL;