Update latch.py

Add support for Python2