Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sshuttle/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
resolvconf_nameservers
from sshuttle.methods import get_method, Features

_extra_fd = os.open('/dev/null', os.O_RDONLY)
_extra_fd = os.open(os.devnull, os.O_RDONLY)


def got_signal(signum, frame):
Expand Down Expand Up @@ -76,7 +76,7 @@ def daemonize():
# be deleted.
signal.signal(signal.SIGTERM, got_signal)

si = open('/dev/null', 'r+')
si = open(os.devnull, 'r+')
os.dup2(si.fileno(), 0)
os.dup2(si.fileno(), 1)
si.close()
Expand Down Expand Up @@ -323,7 +323,7 @@ def onaccept_tcp(listener, method, mux, handlers):
sock, srcip = listener.accept()
sock.close()
finally:
_extra_fd = os.open('/dev/null', os.O_RDONLY)
_extra_fd = os.open(os.devnull, os.O_RDONLY)
return
else:
raise
Expand Down
2 changes: 1 addition & 1 deletion sshuttle/hostwatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
hostnames = {}
queue = {}
try:
null = open('/dev/null', 'wb')
null = open(os.devnull, 'wb')
except IOError as e:
log('warning: %s\n' % e)
null = os.popen("sh -c 'while read x; do :; done'", 'wb', 4096)
Expand Down
2 changes: 1 addition & 1 deletion sshuttle/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def connect(ssh_cmd, rhostport, python, stderr, options):
if python:
pycmd = "'%s' -c '%s'" % (python, pyscript)
else:
pycmd = ("P=python3.5; $P -V 2>/dev/null || P=python; "
pycmd = ("P=python3.5; $P -V 2>" + os.devnull + " || P=python; "
"exec \"$P\" -c '%s'") % pyscript
argv = (sshl +
portl +
Expand Down