Skip to content

Commit 99050aa

Browse files
committed
Fix for Python3.5.
1 parent 021e6f5 commit 99050aa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sshuttle/tests/test_helpers.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from mock import patch, call
2+
import sys
23
import io
34
import socket
45

@@ -162,4 +163,9 @@ def test_family_ip_tuple():
162163
def test_family_to_string():
163164
assert sshuttle.helpers.family_to_string(socket.AF_INET) == "AF_INET"
164165
assert sshuttle.helpers.family_to_string(socket.AF_INET6) == "AF_INET6"
165-
assert sshuttle.helpers.family_to_string(socket.AF_UNIX) == "1"
166+
if sys.version_info < (3, 0):
167+
expected = "1"
168+
assert sshuttle.helpers.family_to_string(socket.AF_UNIX) == "1"
169+
else:
170+
expected = 'AddressFamily.AF_UNIX'
171+
assert sshuttle.helpers.family_to_string(socket.AF_UNIX) == expected

0 commit comments

Comments
 (0)