Imported Upstream version 2.28.4
[platform/upstream/pygobject2.git] / dsextras.py
index ef848e2..b2c9e90 100644 (file)
@@ -69,7 +69,7 @@ def getstatusoutput(cmd):
         text = pipe.read()
         sts = pipe.close() or 0
 
-        if text[-1:] == '\n':
+        while text[-1:] in ['\n', '\r']:
             text = text[:-1]
 
         return sts, text
@@ -271,7 +271,7 @@ class InstallData(install_data):
 
         output = os.path.join(install_dir, output_file)
         self.mkpath(install_dir)
-        open(output, 'w').write(template)
+        open(output, 'wb').write(template)
         self.local_inputs.append(filename)
         self.local_outputs.append(output)
         return output