[GRASS-SVN] r73493 - grass/trunk/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Oct 6 20:18:04 PDT 2018


Author: annakrat
Date: 2018-10-06 20:18:04 -0700 (Sat, 06 Oct 2018)
New Revision: 73493

Modified:
   grass/trunk/gui/wxpython/gui_core/query.py
Log:
wxGUI: fix querying for Python 2/3, see #3673

Modified: grass/trunk/gui/wxpython/gui_core/query.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/query.py	2018-10-07 00:18:51 UTC (rev 73492)
+++ grass/trunk/gui/wxpython/gui_core/query.py	2018-10-07 03:18:04 UTC (rev 73493)
@@ -211,7 +211,6 @@
 
 def QueryTreeBuilder(data, column):
     """Builds tree model from query results.
-    Convert to unicode.
 
     :param data: query results as a dictionary
     :param column: column name
@@ -220,16 +219,12 @@
     """
     def addNode(parent, data, model):
         for k, v in six.iteritems(data):
-            if isinstance(v, str):
-                k = DecodeString(k)
             if isinstance(v, dict):
                 node = model.AppendNode(parent=parent, label=k)
                 addNode(parent=node, data=v, model=model)
             else:
-                if not isinstance(v, str):
+                if not isinstance(v, six.string_types):
                     v = str(v)
-                elif isinstance(v, str):
-                    v = DecodeString(v)
                 node = model.AppendNode(parent=parent, label=k,
                                         data={column: v})
 



More information about the grass-commit mailing list