Make sure we have a list.
hasattr changed in Python3.
httplib compatibility with python3.