Skip to content

Commit

Permalink
Fixed typo (py2)
Browse files Browse the repository at this point in the history
  • Loading branch information
SeaHOH committed Jul 6, 2020
1 parent dc815ec commit a109945
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions extproxy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
This script is using a non-side-effects monkey patch, it did not applied to
build-in module socket, just inject some codes into `Request`, `ProxyHandler`,
`HTTPConnection`, `SSLContext` method's processing. Don't need to worry about
`HTTPConnection`, `SSLContext` method's processing. No need to worry about
the patching, you can using everything like before, or you can unpatch it at
any time.
Expand Down Expand Up @@ -69,7 +69,7 @@
extproxy.restore_items()
"""

__version__ = "0.1.3"
__version__ = "0.1.4"
__author__ = "SeaHOH<seahoh@gmail.com>"

from .extra import *
Expand Down
4 changes: 3 additions & 1 deletion extproxy/socket_inet_p.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def inet_pton(family, ip_string):
% type(ip_string).__name__)
try:
parts = _explode_ip_string(ip_string).split(":")
if len(parts) == 7:
if len(parts) == 8:
return pack("!8H", *[int(i, 16) for i in parts])
else:
ip4 = inet_aton(parts.pop())
Expand Down Expand Up @@ -57,6 +57,8 @@ def inet_ntop(family, ip_packed):


def _explode_ip_string(ip_string):
if ip_string[:1] = "[":
ip_string = [1:-1]
assert 1 < len(ip_string) < 40, 0
if ip_string[:1] == ":":
assert ip_string[:2] == "::", 0
Expand Down

0 comments on commit a109945

Please sign in to comment.