'apply' does not exist in Python3

As this problem has existed for ages, you probably want to write a test case for tsafe.py …