[GRASS-SVN] r68362 - grass/trunk/lib/python/script

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


Author: zarch
Date: 2016-05-02 09:09:11 -0700 (Mon, 02 May 2016)
New Revision: 68362

Modified:
   grass/trunk/lib/python/script/utils.py
Log:
script.utils: fix typo in the doctstring and make documentation and source code clearer

Modified: grass/trunk/lib/python/script/utils.py
===================================================================
--- grass/trunk/lib/python/script/utils.py	2016-05-02 16:09:03 UTC (rev 68361)
+++ grass/trunk/lib/python/script/utils.py	2016-05-02 16:09:11 UTC (rev 68362)
@@ -150,19 +150,19 @@
         self[key] = value
 
 
-def decode(string):
-    """Decode string with defualt locale
+def decode(bytes):
+    """Decode bytes with default locale
 
-    :param str string: the string to decode
+    :param bytes bytes: the bytes to decode
     """
     enc = locale.getdefaultlocale()[1]
-    if hasattr(string, 'decode'):
-        return string.decode(enc) if enc else string.decode()
-    return string
+    if hasattr(bytes, 'decode'):
+        return bytes.decode(enc) if enc else bytes.decode()
+    return bytes
 
 
 def encode(string):
-    """Encode string with defualt locale
+    """Encode string with default locale -> bytes
 
     :param str string: the string to encode
     """
@@ -294,7 +294,7 @@
                 modname=modname, libname=libname,
                 pathsep=os.pathsep
             )
-    
+
     return path
 
 



More information about the grass-commit mailing list