Skip to content

Commit

Permalink
There is no need to monkeypatch inet_aton
Browse files Browse the repository at this point in the history
http://docs.python.org/2/library/socket.html#socket.inet_aton

It's a simple conversion function. Also, if you decide to monkeypatch it, it should be with something that does something similar to the original one, not with a function that does something completely different.
  • Loading branch information
andresriancho committed Jun 14, 2013
1 parent 3a65ba5 commit a2d6dfc
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions httpretty/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,6 @@ def disable(cls):
socket.gethostname = old_gethostname
socket.gethostbyname = old_gethostbyname
socket.getaddrinfo = old_getaddrinfo
socket.inet_aton = old_gethostbyname

socket.__dict__['socket'] = old_socket
socket.__dict__['_socketobject'] = old_socket
Expand All @@ -720,7 +719,6 @@ def disable(cls):
socket.__dict__['gethostname'] = old_gethostname
socket.__dict__['gethostbyname'] = old_gethostbyname
socket.__dict__['getaddrinfo'] = old_getaddrinfo
socket.__dict__['inet_aton'] = old_gethostbyname

if socks:
socks.socksocket = old_socksocket
Expand Down Expand Up @@ -751,7 +749,6 @@ def enable(cls):
socket.gethostname = fake_gethostname
socket.gethostbyname = fake_gethostbyname
socket.getaddrinfo = fake_getaddrinfo
socket.inet_aton = fake_gethostbyname

socket.__dict__['socket'] = fakesock.socket
socket.__dict__['_socketobject'] = fakesock.socket
Expand All @@ -760,7 +757,6 @@ def enable(cls):
socket.__dict__['create_connection'] = create_fake_connection
socket.__dict__['gethostname'] = fake_gethostname
socket.__dict__['gethostbyname'] = fake_gethostbyname
socket.__dict__['inet_aton'] = fake_gethostbyname
socket.__dict__['getaddrinfo'] = fake_getaddrinfo

if socks:
Expand Down

0 comments on commit a2d6dfc

Please sign in to comment.