summaryrefslogtreecommitdiff
path: root/grc/gui/external_editor.py
diff options
context:
space:
mode:
authorSebastian Koslowski <koslowski@kit.edu>2017-03-09 21:23:51 +0100
committerSebastian Koslowski <koslowski@kit.edu>2017-03-09 21:24:04 +0100
commit00e775ff3e78f9e0fd216e683c958ed820363fac (patch)
tree7e5a0de42af8fdf8f2ce8cf4fc18763d1d6a5f8b /grc/gui/external_editor.py
parent50bfc3d1bd52b537e529a3128d294c9e9fe3888e (diff)
parent69776b6a60a8aa1bcd650e681326141b3c1ec866 (diff)
Merge branch 'gtk3' into python3
Diffstat (limited to 'grc/gui/external_editor.py')
-rw-r--r--grc/gui/external_editor.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/grc/gui/external_editor.py b/grc/gui/external_editor.py
index 010bd71d1a..155b0915c5 100644
--- a/grc/gui/external_editor.py
+++ b/grc/gui/external_editor.py
@@ -17,6 +17,8 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
+from __future__ import absolute_import, print_function
+
import os
import sys
import time
@@ -67,7 +69,7 @@ class ExternalEditor(threading.Thread):
time.sleep(1)
except Exception as e:
- print >> sys.stderr, "file monitor crashed:", str(e)
+ print("file monitor crashed:", str(e), file=sys.stderr)
finally:
try:
os.remove(self.filename)
@@ -76,10 +78,7 @@ class ExternalEditor(threading.Thread):
if __name__ == '__main__':
- def p(data):
- print data
-
- e = ExternalEditor('/usr/bin/gedit', "test", "content", p)
+ e = ExternalEditor('/usr/bin/gedit', "test", "content", print)
e.open_editor()
e.start()
time.sleep(15)