summaryrefslogtreecommitdiff
blob: 9d2a9fadca4051564d245316a04de8be9078b5f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Steven Robertson <nihilismwow@gmail.com>
https://bugs.gentoo.org/show_bug.cgi?id=240188
http://code.google.com/p/quodlibet/issues/detail?id=27


Index: quodlibet/gdist/core.py
===================================================================
--- quodlibet/gdist/core.py	(revision 4331)
+++ quodlibet/gdist/core.py	(working copy)
@@ -10,7 +10,7 @@
 This module exists to avoid circular imports within gdist.
 """
 
-import os
+import os, subprocess
 
 from distutils.core import Command
 
@@ -26,8 +26,11 @@
         self.po_directory = self.distribution.po_directory
 
     def capture(self, args):
-        write, read = os.popen2(args, mode="r")
-        return read.read()
+        p = subprocess.Popen(args, stdout=subprocess.PIPE)
+        ret = p.wait()
+        if ret != 0:
+            raise SystemExit("External program %s exited with error %d." % (args[0], ret))
+        return p.stdout.read()
 
     def check_po(self):
         """Exit if translation is needed and not available"""