Revision: 2591
Author: janne.t.harkonen
Date: Wed Mar  3 06:24:44 2010
Log: workaround for bug in Jython 2.5
http://code.google.com/p/robotframework/source/detail?r=2591

Modified:
 /trunk/src/robot/libraries/OperatingSystem.py

=======================================
--- /trunk/src/robot/libraries/OperatingSystem.py       Wed Mar  3 06:14:26 2010
+++ /trunk/src/robot/libraries/OperatingSystem.py       Wed Mar  3 06:24:44 2010
@@ -169,7 +169,9 @@
     def _run(self, command, mode):
         process = os.popen(self._process_command(command))
         stdout = self._decode_from_system(process.read())
-        if stdout.endswith('\n'):
+        if stdout.endswith('\r\n'):
+            stdout = stdout[:-2]
+        elif stdout.endswith('\n'):
             stdout = stdout[:-1]
         try:
             rc = process.close()
@@ -1312,7 +1314,9 @@
         if self.closed:
             raise DataError('Cannot read from a closed process')
         out = self.stdout.read()
-        if out.endswith('\n'):
+        if out.endswith('\r\n'):
+            out = out[:-2]
+        elif out.endswith('\n'):
             out = out[:-1]
         self.close()
         return out

Reply via email to