mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-03-01 08:41:14 +01:00
remove version_info based branching
This commit is contained in:
parent
ec2018d664
commit
d0f0aa9f17
@ -228,12 +228,7 @@ class FirewallClient:
|
|||||||
pass
|
pass
|
||||||
self.argv = argv
|
self.argv = argv
|
||||||
s1.close()
|
s1.close()
|
||||||
if sys.version_info < (3, 0):
|
self.pfile = s2.makefile('rwb')
|
||||||
# python 2.7
|
|
||||||
self.pfile = s2.makefile('wb+')
|
|
||||||
else:
|
|
||||||
# python 3.5
|
|
||||||
self.pfile = s2.makefile('rwb')
|
|
||||||
if e:
|
if e:
|
||||||
log('Spawning firewall manager: %r\n' % self.argv)
|
log('Spawning firewall manager: %r\n' % self.argv)
|
||||||
raise Fatal(e)
|
raise Fatal(e)
|
||||||
|
@ -5,16 +5,11 @@ import errno
|
|||||||
logprefix = ''
|
logprefix = ''
|
||||||
verbose = 0
|
verbose = 0
|
||||||
|
|
||||||
if sys.version_info[0] == 3:
|
binary_type = bytes
|
||||||
binary_type = bytes
|
|
||||||
|
|
||||||
def b(s):
|
|
||||||
return s.encode("ASCII")
|
|
||||||
else:
|
|
||||||
binary_type = str
|
|
||||||
|
|
||||||
def b(s):
|
def b(s):
|
||||||
return s
|
return s.encode("ASCII")
|
||||||
|
|
||||||
|
|
||||||
def log(s):
|
def log(s):
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import sys
|
|
||||||
import io
|
import io
|
||||||
import socket
|
import socket
|
||||||
from socket import AF_INET, AF_INET6
|
from socket import AF_INET, AF_INET6
|
||||||
@ -193,9 +192,5 @@ def test_family_ip_tuple():
|
|||||||
def test_family_to_string():
|
def test_family_to_string():
|
||||||
assert sshuttle.helpers.family_to_string(AF_INET) == "AF_INET"
|
assert sshuttle.helpers.family_to_string(AF_INET) == "AF_INET"
|
||||||
assert sshuttle.helpers.family_to_string(AF_INET6) == "AF_INET6"
|
assert sshuttle.helpers.family_to_string(AF_INET6) == "AF_INET6"
|
||||||
if sys.version_info < (3, 0):
|
expected = 'AddressFamily.AF_UNIX'
|
||||||
expected = "1"
|
|
||||||
assert sshuttle.helpers.family_to_string(socket.AF_UNIX) == "1"
|
|
||||||
else:
|
|
||||||
expected = 'AddressFamily.AF_UNIX'
|
|
||||||
assert sshuttle.helpers.family_to_string(socket.AF_UNIX) == expected
|
assert sshuttle.helpers.family_to_string(socket.AF_UNIX) == expected
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
if sys.version_info >= (3, 0):
|
good_python = sys.version_info >= (3, 5)
|
||||||
good_python = sys.version_info >= (3, 5)
|
|
||||||
else:
|
|
||||||
good_python = sys.version_info >= (2, 7)
|
|
||||||
|
|
||||||
collect_ignore = []
|
collect_ignore = []
|
||||||
if not good_python:
|
if not good_python:
|
||||||
|
Loading…
Reference in New Issue
Block a user