Python3 compliance for decorator