Python Forum

Full Version: httplib to http.client conversion issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am a relatively newbie, dealing with python 2.7 code that needs to go to python 3.6 or 3.7
In the code I have 'import httplib' that I dutifully changed to 'import http.client as httplib'

Later in the code I have:

class whateverHTTPS(httplib.HTTP):

To that I get the error:
AttributeError: module 'http.client' has no attribute 'HTTP'

I searched the online documentation for httplib and indeed did not find HTTP

Attempted to change the code to:

class whateverHTTPS(httpclient.HTTP):

produces the error:
NameError: name 'http' is not defined

can somebody please shed light on my mistake
Thanks
ZA
Please show code.