python 3 compatibility

Replaces #9 merging into hydro-devel branch only.