Examples py3 compat

The changes as per ipython/ipython#2627, made against your branch.