[gedit] tools: correctly compare file descriptors



commit 843eb35ba012ee45ccb724eed57cb82955d4ac3d
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Tue Apr 2 16:05:05 2013 +0200

    tools: correctly compare file descriptors

 plugins/externaltools/tools/capture.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plugins/externaltools/tools/capture.py b/plugins/externaltools/tools/capture.py
index 553f5a9..81fa79f 100644
--- a/plugins/externaltools/tools/capture.py
+++ b/plugins/externaltools/tools/capture.py
@@ -157,7 +157,7 @@ class Capture(GObject.Object):
 
     def process_read_buffer(self, source):
         if self.read_buffer:
-            if source == self.pipe.stdout:
+            if source.unix_get_fd() == self.pipe.stdout.fileno():
                 self.emit('stdout-line', self.read_buffer)
             else:
                 self.emit('stderr-line', self.read_buffer)
@@ -184,7 +184,7 @@ class Capture(GObject.Object):
                     self.read_buffer = ''
 
                 for line in lines:
-                    if not self.pipe or source == self.pipe.stdout:
+                    if not self.pipe or source.unix_get_fd() == self.pipe.stdout.fileno():
                         self.emit('stdout-line', line)
                     else:
                         self.emit('stderr-line', line)


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