[Python-checkins] python/dist/src/Objects abstract.c,2.93.6.3,2.93.6.4

anthonybaxter@sourceforge.net anthonybaxter@sourceforge.net
Wed, 17 Apr 2002 21:40:08 -0700


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

Modified Files:
      Tag: release22-maint
	abstract.c 
Log Message:
backport gvanrossum's patch:

SF bug 544647.

PyNumber_InPlaceMultiply insisted on calling sq_inplace_repeat if it
existed, even if nb_inplace_multiply also existed and the arguments
weren't right for sq_inplace_repeat.  Change this to only use
sq_inplace_repeat if nb_inplace_multiply isn't defined.

Bugfix candidate.


Index: abstract.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v
retrieving revision 2.93.6.3
retrieving revision 2.93.6.4
diff -C2 -d -r2.93.6.3 -r2.93.6.4
*** abstract.c	11 Mar 2002 10:12:58 -0000	2.93.6.3
--- abstract.c	18 Apr 2002 04:40:05 -0000	2.93.6.4
***************
*** 741,746 ****
  {
  	PyObject * (*g)(PyObject *, int) = NULL;
! 	if (HASINPLACE(v) && v->ob_type->tp_as_sequence &&
! 		(g = v->ob_type->tp_as_sequence->sq_inplace_repeat)) {
  		long n;
  		if (PyInt_Check(w)) {
--- 741,750 ----
  {
  	PyObject * (*g)(PyObject *, int) = NULL;
! 	if (HASINPLACE(v) &&
! 	    v->ob_type->tp_as_sequence &&
! 	    (g = v->ob_type->tp_as_sequence->sq_inplace_repeat) &&
! 	    !(v->ob_type->tp_as_number &&
! 	      v->ob_type->tp_as_number->nb_inplace_multiply))
! 	{
  		long n;
  		if (PyInt_Check(w)) {