Use Harmonify. It's a new library meant for patching Python code is really easy to use, and can be installed via pip.
pip