Skip to content

Commit 641a193

Browse files
committed
Use readline instead of next.
1 parent 71d17e4 commit 641a193

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sshuttle/tests/test_firewall.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,22 @@ def test_rewrite_etc_hosts():
4141
}
4242
sshuttle.firewall.rewrite_etc_hosts(10)
4343
with open("tmp/hosts") as f:
44-
line = f.next()
44+
line = f.readline()
4545
s = line.split()
4646
assert s == ['1.2.3.3', 'existing']
4747

48-
line = f.next()
48+
line = f.readline()
4949
s = line.split()
5050
assert s == ['1.2.3.4', 'myhost',
5151
'#', 'sshuttle-firewall-10', 'AUTOCREATED']
5252

53-
line = f.next()
53+
line = f.readline()
5454
s = line.split()
5555
assert s == ['1.2.3.5', 'myotherhost',
5656
'#', 'sshuttle-firewall-10', 'AUTOCREATED']
5757

58-
with pytest.raises(StopIteration):
59-
line = f.next()
58+
line = f.readline()
59+
assert line == ""
6060

6161
sshuttle.firewall.restore_etc_hosts(10)
6262
assert filecmp.cmp("tmp/hosts.orig", "tmp/hosts", shallow=False) is True

0 commit comments

Comments
 (0)