GNOME Bugzilla – Bug 312999
nasty printout when making objects in ipython
Last modified: 2006-01-09 14:13:52 UTC
import gst gst.element_factory_make('ffmpegcolorspace') returns the correct thing, but while doing so, tries to define the GstFFMpegColorspace name in the __main__ module from sys.modules. Which is a broken behavior, but hey, it's enshrined in history so that can't be changed. The problem is that for ipython, In [6]:sys.modules['__main__'] Out[6]:<IPython.FakeModule instance> So that when it tries to define the class in __main__, it prints: <ERROR: ../Objects/moduleobject.c:48: bad argument to internal function> Because sys.modules['__main__'] isn't really a module. Attached patch will work around this issue.
Created attachment 50458 [details] [review] check module type first
jdahlin suggested using PyObject_SetItem. I tried it and it doesn't work for the normal case or for the ipython case. Suggest that this patch be applied. This behavior of pygtk is *extremely* crack anyway.
Created attachment 50461 [details] [review] new patch, uses generic setattr protocol
Committed attachment #50461 [details], with some error checking, to HEAD.