[totem] opensubtitles: Fix possible use before assignment



commit 86e46caa9f22fb68eaaecb88fc6446db3b426981
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Apr 18 22:45:45 2015 +0200

    opensubtitles: Fix possible use before assignment
    
    If fetching subtitles fails, the follow error could occur:
    UnboundLocalError: local variable 'suburi' referenced before assignment

 src/plugins/opensubtitles/opensubtitles.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/opensubtitles/opensubtitles.py b/src/plugins/opensubtitles/opensubtitles.py
index b7d6729..e58636b 100644
--- a/src/plugins/opensubtitles/opensubtitles.py
+++ b/src/plugins/opensubtitles/opensubtitles.py
@@ -626,6 +626,7 @@ class OpenSubtitles (GObject.Object, # pylint: disable-msg=R0902
             return True
 
         subtitles = download_thread.get_subtitles ()
+        suburi = None
         if subtitles:
             subtitle_file = Gio.file_new_for_uri (self._filename)
             movie_name = subtitle_file.get_basename ().rpartition ('.')[0]


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