small py3 fixes
@y-p correcting those small fixes I mentioned in the comments of your commit.

Thanks, can you test 3d155cc on PY3?
 Works, thanks! :+1:
 Wait, so the docs compile on py3 now?
 Yes, they do with the latest master.

(I see you added the fixes yourself)
 I thought the code examples were not py3 compat?
 Anyway, I'll test doc code fixes on PY3 in the future as to not break things again. 
Thanks for reporting.
 Yes, the code examples in the documentation are still not py3 compatible yet. I am just talking about the doc build process here.

OK, thanks, it would be great if you guys tested any changes to these sphinx extensions and the make.py script on Python 3 in the future (so that we don't have to redo the same work).
