diff cmd2.py @ 376:32b9137577b8

avoiding 'str doesn't support the buffer api' exception
author cat@eee
date Sun, 21 Feb 2010 15:25:22 -0500
parents bc4b956d57b6
children 70ca35d96c49
line wrap: on
line diff
--- a/cmd2.py	Sat Feb 20 09:26:33 2010 -0500
+++ b/cmd2.py	Sun Feb 21 15:25:22 2010 -0500
@@ -1438,7 +1438,10 @@
         self.trap.seek(0)
         result = self.trap.read()
         self.trap.truncate(0)
-        return result.strip('\x00')        
+        try:
+            return result.strip('\x00') #TODO: understand this
+        except TypeError:
+            return result
     def tearDown(self):
         sys.stdout = self.old_stdout