[pygobject/pygobject-2-28] dsextras.py: remove \r as wel as \n character



commit b7449d63e0c1bdfb5acbd8c5ec073711441301b9
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date:   Tue Mar 22 11:35:44 2011 +0100

    dsextras.py: remove \r as wel as \n character

 dsextras.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/dsextras.py b/dsextras.py
index ef848e2..6f8316d 100644
--- a/dsextras.py
+++ b/dsextras.py
@@ -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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]