Python 3 compat fix for callable()