[Checkins] SVN: zope.proxy/branches/regebro-python3/src/zope/proxy/_zope_proxy_proxy.c Cleanup + support for Python 2.4 and 2.5. Still two tests failing in Python 3.1.

Lennart Regebro regebro at gmail.com
Sat Nov 20 16:04:08 EST 2010


Log message for revision 118513:
  Cleanup + support for Python 2.4 and 2.5. Still two tests failing in Python 3.1.
  

Changed:
  U   zope.proxy/branches/regebro-python3/src/zope/proxy/_zope_proxy_proxy.c

-=-
Modified: zope.proxy/branches/regebro-python3/src/zope/proxy/_zope_proxy_proxy.c
===================================================================
--- zope.proxy/branches/regebro-python3/src/zope/proxy/_zope_proxy_proxy.c	2010-11-20 18:35:47 UTC (rev 118512)
+++ zope.proxy/branches/regebro-python3/src/zope/proxy/_zope_proxy_proxy.c	2010-11-20 21:04:07 UTC (rev 118513)
@@ -204,8 +204,8 @@
 
 #if PY_MAJOR_VERSION < 3 && defined(Py_USING_UNICODE)
     /* The Unicode to string conversion is done here because the
-       existing tp_getattro slots expect a string object as name
-       and we wouldn't want to break those. */
+       existing tp_setattro slots expect a string object as name
+       (except under Python 3) and we wouldn't want to break those. */
     if (PyUnicode_Check(name)) {
         name = PyUnicode_AsEncodedString(name, NULL, NULL);
         if (name == NULL)
@@ -389,10 +389,6 @@
 }
 
 /*
- *   Number methods
- */
-
-/*
  * Number methods.
  */
 
@@ -852,6 +848,12 @@
  * be associated with the wrapper itself.
  */
 
+// Python < 2.6	support:
+#ifndef PyVarObject_HEAD_INIT
+  #define PyVarObject_HEAD_INIT(type, size) \
+          _PyObject_EXTRA_INIT 1, type, size,
+#endif
+
 static PyTypeObject
 ProxyType = {
     PyVarObject_HEAD_INIT(NULL, 0)



More information about the checkins mailing list