diff options
author | Martin Pitt <martinpitt@gnome.org> | 2013-05-29 15:39:09 +0200 |
---|---|---|
committer | Martin Pitt <martinpitt@gnome.org> | 2013-05-29 15:42:52 +0200 |
commit | 9fcbba900c87a41a85281bec3ee1989258f3a3db (patch) | |
tree | d78a51b75aa21dfae3808b503b574ccdb4e9ed23 /test | |
parent | 8f0ffa1f5b8c541f30d73b99aee8e2aab574c28d (diff) | |
download | gvfs-9fcbba900c87a41a85281bec3ee1989258f3a3db.tar.gz |
gvfs-test: Fix for Python 3.3
Use read() instead of readall() for reading from subprocess, as this is a
BufferedReader() now. This also works for older Python versions.
Also, add another missing Popen.stdin.flush(), like in the previous commit.
Diffstat (limited to 'test')
-rwxr-xr-x | test/gvfs-test | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/gvfs-test b/test/gvfs-test index 008e3be8..6c0fc119 100755 --- a/test/gvfs-test +++ b/test/gvfs-test @@ -935,7 +935,7 @@ class Drive(GvfsTestCase): ctx = GLib.MainContext().default() while ctx.iteration(False): pass - self.monitor.stdout.readall() + self.monitor.stdout.read() def setUp(self): self.mock_polkit = None @@ -1203,7 +1203,7 @@ pkill --signal HUP udevd || pkill --signal HUP systemd-udevd empty_timeout = 50 while True: - out = self.monitor.stdout.readall() + out = self.monitor.stdout.read() if out: break else: @@ -1215,7 +1215,7 @@ pkill --signal HUP udevd || pkill --signal HUP systemd-udevd # wait a bit more to see whether we catch some stragglers time.sleep(0.2) - out2 = self.monitor.stdout.readall() + out2 = self.monitor.stdout.read() if out2: out += out2 @@ -1229,6 +1229,8 @@ pkill --signal HUP udevd || pkill --signal HUP systemd-udevd stdin=subprocess.PIPE) self.mock_polkit.stdin.write(('set -e\n/home/test_polkitd.py -r -a %s\n' % ','.join(actions)).encode('ASCII')) + self.mock_polkit.stdin.flush() + # wait until it started up if actions: timeout = 50 |