[gedit/wip/python3] pythonconsole: correctly handle the run



commit 33b677b8398c9dbaf1af0853cea99f8591c7c9b0
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Sat Oct 27 18:48:34 2012 +0200

    pythonconsole: correctly handle the run

 plugins/pythonconsole/pythonconsole/console.py |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/plugins/pythonconsole/pythonconsole/console.py b/plugins/pythonconsole/pythonconsole/console.py
index 7d3f032..50d48a7 100644
--- a/plugins/pythonconsole/pythonconsole/console.py
+++ b/plugins/pythonconsole/pythonconsole/console.py
@@ -209,7 +209,7 @@ class PythonConsole(Gtk.ScrolledWindow):
                 com_mark = "... "
             else:
                 # Eval the command
-                self.__run(bytes(self.current_command, 'utf-8'))
+                self.__run(self.current_command)
                 self.current_command = ''
                 self.block_command = False
                 com_mark = ">>> "
@@ -356,11 +356,11 @@ class PythonConsole(Gtk.ScrolledWindow):
             for c in command:
                 if display_command:
                     self.write(">>> " + c + "\n", self.command)
-                self.__run(bytes(c, 'utf-8'))
+                self.__run(c)
         else:
             if display_command:
                 self.write(">>> " + c + "\n", self.command)
-            self.__run(bytes(command, 'utf-8'))
+            self.__run(command)
 
         cur = buf.get_end_iter()
         buf.move_mark_by_name("input-line", cur)
@@ -373,11 +373,6 @@ class PythonConsole(Gtk.ScrolledWindow):
         sys.stdout, self.stdout = self.stdout, sys.stdout
         sys.stderr, self.stderr = self.stderr, sys.stderr
 
-        # eval and exec are broken in how they deal with utf8-encoded
-        # strings so we have to explicitly decode the command before
-        # passing it along
-        command = command.decode('utf8')
-
         try:
             try:
                 r = eval(command, self.namespace, self.namespace)



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