[LWN Logo]

From: Guido van Rossum <guido@CNRI.Reston.VA.US>
Subject: Re: Missing PySequence_In in 1.5.2b2 causing problems with existing .pyd on win32
Date: Wed, 17 Mar 1999 09:50:12 -0500
To: "Brad Clements" <bkc@murkworks.com>

> Subject says it all.
> 
> Any plans to re-instate this call and PyEval_CallObject
> 
> I know the source says "uncomment for backwards compat", but then I have a
> different python.dll than everyone else.
> 
> Btw, this is causing problems with Zope..

Good catch!  Even though I intended to have DLL-level backwards
compatibility, the lack of an appropriate declarations in the .h files
made this not work on Windows.  (And where does the source actually
say anything about uncommenting?  I couldn't find it :-)

The following -- untested -- patches should fix both problems.  Please
test and let me know if it works so I can add it to the distribution!

Index: abstract.h
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Include/abstract.h,v
retrieving revision 2.15
diff -c -r2.15 abstract.h
*** abstract.h	1998/12/04 18:47:50	2.15
--- abstract.h	1999/03/17 14:36:32
***************
*** 754,759 ****
--- 754,765 ----
         */
  
       DL_IMPORT(int) PySequence_Contains Py_PROTO((PyObject *o, PyObject *value));
+ 
+ /* For DLL-level backwards compatibility */
+ #undef PySequence_In
+      DL_IMPORT(int) PySequence_In Py_PROTO((PyObject *o, PyObject *value));
+ 
+ /* For source-level backwards compatibility */
  #define PySequence_In PySequence_Contains
  
         /*

Index: ceval.h
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Include/ceval.h,v
retrieving revision 2.29
diff -c -r2.29 ceval.h
*** ceval.h	1998/12/04 18:47:52	2.29
--- ceval.h	1999/03/17 14:42:31
***************
*** 40,45 ****
--- 40,49 ----
  DL_IMPORT(PyObject *) PyEval_CallObjectWithKeywords
  	Py_PROTO((PyObject *, PyObject *, PyObject *));
  
+ /* DLL-level Backwards compatibility: */
+ #undef PyEval_CallObject
+ DL_IMPORT(PyObject *) PyEval_CallObject Py_PROTO((PyObject *, PyObject *));
+ 
  /* Inline this */
  #define PyEval_CallObject(func,arg) \
          PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL)


--Guido van Rossum (home page: http://www.python.org/~guido/)