[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kate] kate/plugins/pate/src/plugins/console: Repair damage caused by Python3 support.
From: Shaheed Haque <srhaque () theiet ! org>
Date: 2012-11-30 22:10:39
Message-ID: 20121130221039.0FFBDA60C4 () git ! kde ! org
[Download RAW message or body]
Git commit aee4a271ab87b5a2d51b9aa6dc8a66fd093a5320 by Shaheed Haque.
Committed on 30/11/2012 at 23:09.
Pushed by shaheed into branch 'master'.
Repair damage caused by Python3 support.
M +15 -1 kate/plugins/pate/src/plugins/console/console.py
http://commits.kde.org/kate/aee4a271ab87b5a2d51b9aa6dc8a66fd093a5320
diff --git a/kate/plugins/pate/src/plugins/console/console.py \
b/kate/plugins/pate/src/plugins/console/console.py index 4327697..357a653 \
100644
--- a/kate/plugins/pate/src/plugins/console/console.py
+++ b/kate/plugins/pate/src/plugins/console/console.py
@@ -182,6 +182,20 @@ def softspace(file, newvalue):
pass
return oldvalue
+class StringIOHack():
+
+ def __init__(self):
+ self.writeStrings = ""
+
+ def close(self):
+ self.writeStrings = None
+
+ def write(self, s):
+ self.writeStrings += s
+
+ def getvalue(self):
+ return self.writeStrings
+
class Console(code.InteractiveConsole):
''' The standard library module code doesn't provide you with
string when you evaluate an expression (e.g "[]"); instead, it
@@ -189,7 +203,7 @@ class Console(code.InteractiveConsole):
will probably not be massively forward compatible '''
def runcode(self, c):
stdout = sys.stdout
- sys.stdout = StringIO()
+ sys.stdout = StringIOHack()
try:
exec(c, self.locals)
except SystemExit:
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic