oh... ok. Hmmm.. let me see then... maybe the call to PyRun_String. I have no idea how it works. I see you pass pDict in twice? is that correct? Also maybe it does something to the ref count after it returns? What happens to ref count of pDict if PyRun_String fails?