You have to be carefull with these assert, as I told you before, we're working inside the wx thread. I'm not sure what will happen when you assert like this.
I would prefer it if you rewrite these statements to self.assert_