Fixes compatibility with pycallgraph.  Closes #1051