BUG: fix Python 3.1 compatibility, callable() not builtin.  Closes gh-2963.