[GRASS-SVN] r74321 - grass/trunk/lib/python/gunittest

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 27 14:38:46 PDT 2019


Author: sbl
Date: 2019-03-27 14:38:46 -0700 (Wed, 27 Mar 2019)
New Revision: 74321

Modified:
   grass/trunk/lib/python/gunittest/case.py
Log:
fix StrinIO imports Python 2 vs 3

Modified: grass/trunk/lib/python/gunittest/case.py
===================================================================
--- grass/trunk/lib/python/gunittest/case.py	2019-03-27 21:10:19 UTC (rev 74320)
+++ grass/trunk/lib/python/gunittest/case.py	2019-03-27 21:38:46 UTC (rev 74321)
@@ -31,9 +31,10 @@
 
 
 if sys.version_info[0] == 2:
-    import StringIO
+    from StringIO import StringIO
 else:
     from io import StringIO
+    unicode = str
 
 
 class TestCase(unittest.TestCase):
@@ -1024,7 +1025,7 @@
         stdmsg = ("There is a difference between vectors when compared as"
                   " ASCII files.\n")
 
-        output = StringIO.StringIO()
+        output = StringIO()
         # TODO: there is a diff size constant which we can use
         # we are setting it unlimited but we can just set it large
         maxlines = 100



More information about the grass-commit mailing list