[Checkins] SVN: zc.buildout/branches/regebro-python3/src/zc/buildout/ Various fixes. Encountered a bug in distribute, solved in http://bitbucket.org/tarek/distribute/changeset/226bd89d1d69

Lennart Regebro regebro at gmail.com
Mon Nov 22 12:17:51 EST 2010


Log message for revision 118520:
  Various fixes. Encountered a bug in distribute, solved in http://bitbucket.org/tarek/distribute/changeset/226bd89d1d69
  
  

Changed:
  U   zc.buildout/branches/regebro-python3/src/zc/buildout/buildout.py
  U   zc.buildout/branches/regebro-python3/src/zc/buildout/buildout.txt
  U   zc.buildout/branches/regebro-python3/src/zc/buildout/testing.py
  U   zc.buildout/branches/regebro-python3/src/zc/buildout/tests.py

-=-
Modified: zc.buildout/branches/regebro-python3/src/zc/buildout/buildout.py
===================================================================
--- zc.buildout/branches/regebro-python3/src/zc/buildout/buildout.py	2010-11-21 21:54:53 UTC (rev 118519)
+++ zc.buildout/branches/regebro-python3/src/zc/buildout/buildout.py	2010-11-22 17:17:50 UTC (rev 118520)
@@ -1274,7 +1274,6 @@
 
     def __setitem__(self, option, value):
         if not isinstance(value, str):
-            import pdb;pdb.set_trace()
             raise TypeError('Option values must be strings', value)
         self._data[option] = value
 

Modified: zc.buildout/branches/regebro-python3/src/zc/buildout/buildout.txt
===================================================================
--- zc.buildout/branches/regebro-python3/src/zc/buildout/buildout.txt	2010-11-21 21:54:53 UTC (rev 118519)
+++ zc.buildout/branches/regebro-python3/src/zc/buildout/buildout.txt	2010-11-22 17:17:50 UTC (rev 118520)
@@ -808,8 +808,7 @@
     ...         self.options = options
     ...
     ...     def install(self):
-    ...         items = self.options.items()
-    ...         items.sort()
+    ...         items = sorted(self.options.items())
     ...         for option, value in items:
     ...             print(option, value)
     ...         return ()

Modified: zc.buildout/branches/regebro-python3/src/zc/buildout/testing.py
===================================================================
--- zc.buildout/branches/regebro-python3/src/zc/buildout/testing.py	2010-11-21 21:54:53 UTC (rev 118519)
+++ zc.buildout/branches/regebro-python3/src/zc/buildout/testing.py	2010-11-22 17:17:50 UTC (rev 118520)
@@ -463,7 +463,7 @@
             self.send_header('Content-Length', str(len(out)))
             self.send_header('Content-Type', 'text/html')
             self.end_headers()
-            self.wfile.write(out)
+            self.wfile.write(b(out))
             return
 
         self.send_response(200)
@@ -492,7 +492,7 @@
                 self.send_header('Content-Type', 'text/html')
         self.end_headers()
 
-        self.wfile.write(out)
+        self.wfile.write(b(out))
 
     def log_request(self, code):
         if self.__server.__log:

Modified: zc.buildout/branches/regebro-python3/src/zc/buildout/tests.py
===================================================================
--- zc.buildout/branches/regebro-python3/src/zc/buildout/tests.py	2010-11-21 21:54:53 UTC (rev 118519)
+++ zc.buildout/branches/regebro-python3/src/zc/buildout/tests.py	2010-11-22 17:17:50 UTC (rev 118520)
@@ -3773,16 +3773,45 @@
 
 static PyMethodDef methods[] = {{NULL}};
 
+#if PY_MAJOR_VERSION >= 3
+  static struct PyModuleDef moduledef = {
+    PyModuleDef_HEAD_INIT,
+    "extdemo",
+    "",
+    -1,
+    methods,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+  };
+#endif
+
+#ifndef PyInt_FromLong
+   #define PyInt_FromLong PyLong_FromLong
+#endif
+
 PyMODINIT_FUNC
 initextdemo(void)
 {
     PyObject *m;
+
+#if PY_MAJOR_VERSION >= 3
+    m = PyModule_Create(&moduledef);
+#else
     m = Py_InitModule3("extdemo", methods, "");
+#endif
+
 #ifdef TWO
     PyModule_AddObject(m, "val", PyInt_FromLong(2));
 #else
     PyModule_AddObject(m, "val", PyInt_FromLong(EXTDEMO));
 #endif
+
+#if PY_MAJOR_VERSION >= 3
+    return m;
+#endif
+
 }
 """
 



More information about the checkins mailing list