[Checkins] SVN: ExtensionClass/trunk/ Fixed 64-bit compatibility issues for Python 2.5.x / 2.6.x.

Tres Seaver tseaver at palladion.com
Sun Aug 2 13:17:34 EDT 2009


Log message for revision 102422:
  Fixed 64-bit compatibility issues for Python 2.5.x / 2.6.x.
  
  o See http://www.python.org/dev/peps/pep-0353/ for details.
  

Changed:
  A   ExtensionClass/trunk/CHANGES.txt
  U   ExtensionClass/trunk/setup.py
  U   ExtensionClass/trunk/src/ExtensionClass/_ExtensionClass.c
  U   ExtensionClass/trunk/src/ExtensionClass/pickle/pickle.c

-=-
Added: ExtensionClass/trunk/CHANGES.txt
===================================================================
--- ExtensionClass/trunk/CHANGES.txt	                        (rev 0)
+++ ExtensionClass/trunk/CHANGES.txt	2009-08-02 17:17:34 UTC (rev 102422)
@@ -0,0 +1,14 @@
+ExtensionClass Changelog
+========================
+
+2.11.2 (unreleased)
+-------------------
+
+- Fixed 64-bit compatibility issues for Python 2.5.x / 2.6.x.  See 
+  http://www.python.org/dev/peps/pep-0353/ for details.
+
+
+2.11.1 (2009-02-19)
+-------------------
+
+- Initial egg release.

Modified: ExtensionClass/trunk/setup.py
===================================================================
--- ExtensionClass/trunk/setup.py	2009-08-02 17:07:47 UTC (rev 102421)
+++ ExtensionClass/trunk/setup.py	2009-08-02 17:17:34 UTC (rev 102422)
@@ -11,19 +11,22 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""Setup for the Acquisition egg package
+"""Setup for the ExtensionClass egg package
 """
 import os
 from setuptools import setup, find_packages, Extension
 
+README = open('README.txt').read()
+CHANGES = open('CHANGES.txt').read()
+
 setup(name='ExtensionClass',
-      version = '2.11.0dev',
+      version = '2.11.2dev',
       url='http://cheeseshop.python.org/pypi/ExtensionClass',
       license='ZPL 2.1',
       description='Metaclass for subclassable extension types',
       author='Zope Corporation and Contributors',
       author_email='zope-dev at zope.org',
-      long_description=open('README.txt').read(),
+      long_description='\n\n'.join([README, CHANGES]),
 
       packages=find_packages('src'),
       package_dir={'': 'src'},

Modified: ExtensionClass/trunk/src/ExtensionClass/_ExtensionClass.c
===================================================================
--- ExtensionClass/trunk/src/ExtensionClass/_ExtensionClass.c	2009-08-02 17:07:47 UTC (rev 102421)
+++ ExtensionClass/trunk/src/ExtensionClass/_ExtensionClass.c	2009-08-02 17:17:34 UTC (rev 102422)
@@ -729,7 +729,7 @@
 static int
 PyExtensionClass_Export_(PyObject *dict, char *name, PyTypeObject *typ)
 {
-  int ecflags = 0;
+  Py_ssize_t ecflags = 0;
   PyMethodDef *pure_methods = NULL, *mdef = NULL;
   PyObject *m;
 
@@ -765,7 +765,7 @@
       if (typ->tp_clear)
         {
           /* ExtensionClasses stick there flags in the tp_clear slot */
-          ecflags = (int)(typ->tp_clear);
+          ecflags = (Py_ssize_t)(typ->tp_clear);
 
           /* Some old-style flags were set */
 

Modified: ExtensionClass/trunk/src/ExtensionClass/pickle/pickle.c
===================================================================
--- ExtensionClass/trunk/src/ExtensionClass/pickle/pickle.c	2009-08-02 17:07:47 UTC (rev 102421)
+++ ExtensionClass/trunk/src/ExtensionClass/pickle/pickle.c	2009-08-02 17:17:34 UTC (rev 102422)
@@ -24,6 +24,12 @@
 static PyObject *str__slotnames__, *copy_reg_slotnames, *__newobj__;
 static PyObject *str__getnewargs__, *str__getstate__;
 
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+#define PY_SSIZE_T_MAX INT_MAX
+#define PY_SSIZE_T_MIN INT_MIN
+#endif
+
 static int
 pickle_setup(void)
 {
@@ -87,7 +93,8 @@
 {
   PyObject *copy, *key, *value;
   char *ckey;
-  int pos = 0, nr;
+  Py_ssize_t pos = 0;
+  Py_ssize_t nr;
 
   copy = PyDict_New();
   if (copy == NULL)
@@ -212,7 +219,7 @@
 pickle_setattrs_from_dict(PyObject *self, PyObject *dict)
 {
   PyObject *key, *value;
-  int pos = 0;
+  Py_ssize_t pos = 0;
   
   if (! PyDict_Check(dict))
     {



More information about the Checkins mailing list