[GRASS-SVN] r68354 - in grass/trunk/lib/python/pygrass: modules/interface vector

svn_grass at osgeo.org svn_grass at osgeo.org
Mon May 2 09:07:37 PDT 2016


Author: zarch
Date: 2016-05-02 09:07:37 -0700 (Mon, 02 May 2016)
New Revision: 68354

Modified:
   grass/trunk/lib/python/pygrass/modules/interface/parameter.py
   grass/trunk/lib/python/pygrass/vector/table.py
Log:
pygrass: fix missing python3 types

Modified: grass/trunk/lib/python/pygrass/modules/interface/parameter.py
===================================================================
--- grass/trunk/lib/python/pygrass/modules/interface/parameter.py	2016-05-02 16:07:29 UTC (rev 68353)
+++ grass/trunk/lib/python/pygrass/modules/interface/parameter.py	2016-05-02 16:07:37 UTC (rev 68354)
@@ -8,6 +8,11 @@
                         with_statement, print_function, unicode_literals)
 import re
 
+try:
+    from builtins import unicode
+except ImportError:
+    unicode = str
+
 from grass.pygrass.modules.interface.docstring import docstring_property
 from grass.pygrass.modules.interface.read import GETTYPE, element2dict, DOC
 

Modified: grass/trunk/lib/python/pygrass/vector/table.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/table.py	2016-05-02 16:07:29 UTC (rev 68353)
+++ grass/trunk/lib/python/pygrass/vector/table.py	2016-05-02 16:07:37 UTC (rev 68354)
@@ -9,9 +9,13 @@
                         with_statement, print_function, unicode_literals)
 
 import os
-import sys
 
-long = int if sys.version_info[0] == 3 else long
+try:
+    from builtins import long, unicode
+except ImportError:
+    # python3
+    long = int
+    unicode = str
 
 import ctypes
 import numpy as np



More information about the grass-commit mailing list