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