[Image-SIG] help(aggdraw.Draw instance) -> crash on Windows?

Fredrik Lundh fredrik at pythonware.com
Sun Feb 12 13:37:57 CET 2006


Fredrik Lundh wrote:

> looks like
>
>     help(aggdraw.Draw("RGB", (1, 1)))
>
> is enough to cause a crash.

it's type(Draw(...)) that doesn't work as it should.  here's a patch:

@@ -1903,12 +1904,12 @@
     {NULL, NULL}
 };

-extern "C" void
-#ifdef WIN32
-__declspec(dllexport)
-#endif
+DL_EXPORT(void)
 initaggdraw(void)
 {
+    DrawType.ob_type = PathType.ob_type = &PyType_Type;
+    PenType.ob_type = BrushType.ob_type = FontType.ob_type = &PyType_Type;
+
     Py_InitModule("aggdraw", aggdraw_functions);

     PyObject* g = PyDict_New();

</F>





More information about the Image-SIG mailing list