better python3 input handling

Commit 47176b8 breaks python 3 compatibility.  This will fix it.