Move the compatibility code that deals with the wxPython 2.4 version of wxPython.h into the #ifdef branch that includes wxPython.h because it's only needed when wxPython.h is used. Also, it won't compile when USE_WX_PYTHON_SWIG_HACK is set otherwise.