ソースを参照

pygrass:parameter fix string/unicode error

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@68465 15284696-431f-4ddb-bdfa-cd5b030d7da7
Pietro Zambelli 9 年 前
コミット
12a868fd37
1 ファイル変更1 行追加6 行削除
  1. 1 6
      lib/python/pygrass/modules/interface/parameter.py

+ 1 - 6
lib/python/pygrass/modules/interface/parameter.py

@@ -8,11 +8,6 @@ from __future__ import (nested_scopes, generators, division, absolute_import,
                         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
 
@@ -23,6 +18,7 @@ def _check_value(param, value):
     """
     must_val = 'The Parameter <%s>, must be one of the following values: %r'
     req = 'The Parameter <%s>, require: %s, get: %s instead: %r\n%s'
+    string = (type(b''), type(u''))
 
     def raiseexcpet(exc, param, ptype, value):
         """Function to modifa the error message"""
@@ -37,7 +33,6 @@ def _check_value(param, value):
 
     def check_string(value):
         """Function to check that a string parameter is already a string"""
-        string = (str, unicode)
         if param.type in string:
             if type(value) in (int, float):
                 value = str(value)