Do not return anything for python 2
Refactor previous commit
Fix potential reference leak
Merge pull request #3303 from ContinuumIO/rational_fix

Fix clang build issue