Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sshuttle
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pub
sshuttle
Commits
d0f0aa9f
Commit
d0f0aa9f
authored
Jun 03, 2020
by
Joshua Li
Committed by
Brian May
Jun 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove version_info based branching
parent
ec2018d6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
24 deletions
+6
-24
client.py
sshuttle/client.py
+1
-6
helpers.py
sshuttle/helpers.py
+3
-8
test_helpers.py
tests/client/test_helpers.py
+1
-6
conftest.py
tests/conftest.py
+1
-4
No files found.
sshuttle/client.py
View file @
d0f0aa9f
...
@@ -228,11 +228,6 @@ class FirewallClient:
...
@@ -228,11 +228,6 @@ class FirewallClient:
pass
pass
self
.
argv
=
argv
self
.
argv
=
argv
s1
.
close
()
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'
)
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
)
...
...
sshuttle/helpers.py
View file @
d0f0aa9f
...
@@ -5,16 +5,11 @@ import errno
...
@@ -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
):
...
...
tests/client/test_helpers.py
View file @
d0f0aa9f
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():
...
@@ -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
=
"1"
assert
sshuttle
.
helpers
.
family_to_string
(
socket
.
AF_UNIX
)
==
"1"
else
:
expected
=
'AddressFamily.AF_UNIX'
expected
=
'AddressFamily.AF_UNIX'
assert
sshuttle
.
helpers
.
family_to_string
(
socket
.
AF_UNIX
)
==
expected
assert
sshuttle
.
helpers
.
family_to_string
(
socket
.
AF_UNIX
)
==
expected
tests/conftest.py
View file @
d0f0aa9f
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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment