Only run python stuff when in python-mode
Merged changes