made hostname work with python 2.4

should fix #9413