[gedit-plugins/wip/python3] Some more fixes



commit 2e1cc823c3394eb252a8e04b6b73d1cf72772370
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Tue Nov 6 19:21:52 2012 +0100

    Some more fixes

 plugins/commander/commander/commands/__init__.py |    6 +++---
 plugins/commander/modules/find/finder.py         |    6 +++---
 plugins/commander/modules/find/regex.py          |    4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/plugins/commander/commander/commands/__init__.py b/plugins/commander/commander/commands/__init__.py
index a938b3b..60c38f6 100644
--- a/plugins/commander/commander/commands/__init__.py
+++ b/plugins/commander/commander/commands/__init__.py
@@ -20,7 +20,7 @@
 #  Boston, MA 02110-1301, USA.
 
 import os
-from gi.repository import GObject, Gio
+from gi.repository import GLib, GObject, Gio
 import sys
 import bisect
 import types
@@ -156,7 +156,7 @@ class Commands(Singleton):
         self._modules = None
 
         for k in self._timeouts:
-            GObject.source_remove(self._timeouts[k])
+            GLib.source_remove(self._timeouts[k])
 
         self._timeouts = {}
 
@@ -448,7 +448,7 @@ class Commands(Singleton):
 
             # We add a timeout because a common save strategy causes a
             # DELETE/CREATE event chain
-            self._timeouts[path] = GObject.timeout_add(500, self.on_timeout_delete, path, mod)
+            self._timeouts[path] = GLib.timeout_add(500, self.on_timeout_delete, path, mod)
         elif evnt == Gio.FileMonitorEvent.CREATED:
             path = gfile1.get_path()
 
diff --git a/plugins/commander/modules/find/finder.py b/plugins/commander/modules/find/finder.py
index c1b030e..6c1270f 100644
--- a/plugins/commander/modules/find/finder.py
+++ b/plugins/commander/modules/find/finder.py
@@ -214,7 +214,7 @@ class Finder:
                         break
 
                 self.entry.info_show('<i>Search hit end of the document</i>', True)
-        except GeneratorExit, e:
+        except GeneratorExit as e:
             self.cancel()
             raise e
 
@@ -269,7 +269,7 @@ class Finder:
 
                 replacestr, words, modifier = (yield commands.result.Prompt('Replace with:'))
                 self.set_replace(replacestr)
-            except GeneratorExit, e:
+            except GeneratorExit as e:
                 if replaceall:
                     self._restore_cursor(startmark)
 
@@ -308,7 +308,7 @@ class Finder:
 
                     break
 
-        except GeneratorExit, e:
+        except GeneratorExit as e:
             if replaceall:
                 self._restore_cursor(startmark)
                 buf.end_user_action()
diff --git a/plugins/commander/modules/find/regex.py b/plugins/commander/modules/find/regex.py
index ed90d18..aaf2f95 100644
--- a/plugins/commander/modules/find/regex.py
+++ b/plugins/commander/modules/find/regex.py
@@ -39,7 +39,7 @@ class RegexFinder(finder.Finder):
 
         try:
             self.findre = re.compile(findstr, self.flags)
-        except Exception, e:
+        except Exception as e:
             raise commands.exceptions.Execute('Invalid regular expression: ' + str(e))
 
     def do_find(self, bounds):
@@ -96,7 +96,7 @@ class RegexFinder(finder.Finder):
     def get_replace(self, text):
         try:
             return self.findre.sub(self._do_re_replace, text)
-        except Exception, e:
+        except Exception as e:
             raise commands.exceptions.Execute('Invalid replacement: ' + str(e))
 
 class SemanticFinder(RegexFinder):



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