OSDN Git Service

dialogs: fix exception when canceling
authorMartin Renold <martinxyz@gmx.ch>
Sun, 24 Oct 2010 15:18:04 +0000 (17:18 +0200)
committerMartin Renold <martinxyz@gmx.ch>
Sun, 24 Oct 2010 15:18:04 +0000 (17:18 +0200)
https://gna.org/bugs/?16944

gui/dialogs.py

index 783c882..e3b88d3 100644 (file)
@@ -54,11 +54,11 @@ def ask_for_name(widget, title, default):
     hbox.pack_start(e)
     d.vbox.show_all()
     if d.run() == gtk.RESPONSE_ACCEPT:
-        result = d.e.get_text()
+        result = d.e.get_text().decode('utf-8')
     else:
         result = None
     d.destroy()
-    return result.decode('utf-8')
+    return result
 
 def error(widget, message):
     window = widget.get_toplevel()