summaryrefslogtreecommitdiff
path: root/grc/gui/Utils.py
diff options
context:
space:
mode:
authorSeth Hitefield <sdhitefield@gmail.com>2017-05-03 07:06:54 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2017-05-03 07:07:59 -0700
commit486e0a9d06e43f3b8669471bef13a5eeedbda4c6 (patch)
tree7d35c5e7fd530f7ff420b9d3bb77ff5fc9fb2ecf /grc/gui/Utils.py
parent97b842874193394285ca4cdc11da381647c285fd (diff)
grc: gtk3: Converted actions to Gio.Action instead of Gtk.Action
Diffstat (limited to 'grc/gui/Utils.py')
-rw-r--r--grc/gui/Utils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/grc/gui/Utils.py b/grc/gui/Utils.py
index 3fffe6dd20..969f3759f2 100644
--- a/grc/gui/Utils.py
+++ b/grc/gui/Utils.py
@@ -21,6 +21,7 @@ from __future__ import absolute_import
from gi.repository import GLib
import cairo
+import six
from .canvas.colors import FLOWGRAPH_BACKGROUND_COLOR
from . import Constants
@@ -107,7 +108,10 @@ def encode(value):
Older versions of glib seg fault if the last byte starts a multi-byte
character.
"""
- valid_utf8 = value.decode('utf-8', errors='replace').encode('utf-8')
+ if six.PY2:
+ valid_utf8 = value.decode('utf-8', errors='replace').encode('utf-8')
+ else:
+ valid_utf8 = value
return GLib.markup_escape_text(valid_utf8)