[pitivi] application: Do not try to 'decode' a string



commit b2b5fe19105fce5d5ffdb4719bdc0363ca1f10bb
Author: Thibault Saunier <tsaunier gnome org>
Date:   Wed Sep 24 18:48:50 2014 +0200

    application: Do not try to 'decode' a string
    
    Making tests pass agin

 pitivi/application.py   |    4 +++-
 pitivi/utils/widgets.py |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/application.py b/pitivi/application.py
index 21375d9..54f9fc3 100644
--- a/pitivi/application.py
+++ b/pitivi/application.py
@@ -201,7 +201,9 @@ class Pitivi(Gtk.Application, Loggable):
     def _versionInfoReceivedCb(self, giofile, result, user_data):
         try:
             raw = giofile.load_contents_finish(result)[1]
-            raw = raw.decode().split("\n")
+            if not isinstance(raw, str):
+                raw = raw.decode()
+            raw = raw.split("\n")
             # Split line at '=' if the line is not empty or a comment line
             data = [element.split("=") for element in raw
                     if element and not element.startswith("#")]
diff --git a/pitivi/utils/widgets.py b/pitivi/utils/widgets.py
index cb5edbc..7ef7d39 100644
--- a/pitivi/utils/widgets.py
+++ b/pitivi/utils/widgets.py
@@ -486,7 +486,7 @@ class PathWidget(Gtk.FileChooserButton, DynamicWidget):
         self.dialog = Gtk.FileChooserDialog(action=action)
         self.dialog.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_CLOSE, 
Gtk.ResponseType.CLOSE)
         self.dialog.set_default_response(Gtk.ResponseType.OK)
-        Gtk.FileChooserButton.__init__(self, self.dialog)
+        Gtk.FileChooserButton.__init__(self, dialog=self.dialog)
         self.dialog.connect("response", self._responseCb)
         self.uri = ""
 


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