@@ -86,15 +86,15 @@ def Decode(data, encoding=None):
8686
8787 try :
8888 # Just return the string if its pure ASCII.
89- return string .decode ('ascii' )
89+ return string .decode ('ascii' ) # pytype: disable=attribute-error
9090 except UnicodeError :
9191 # The string is not ASCII encoded.
9292 pass
9393
9494 # Try the suggested encoding if specified.
9595 if encoding :
9696 try :
97- return string .decode (encoding )
97+ return string .decode (encoding ) # pytype: disable=attribute-error
9898 except UnicodeError :
9999 # Bad suggestion.
100100 pass
@@ -103,21 +103,21 @@ def Decode(data, encoding=None):
103103 # be exceptional if a valid extended ascii encoding with extended chars
104104 # were also a valid UITF-8 encoding.
105105 try :
106- return string .decode ('utf8' )
106+ return string .decode ('utf8' ) # pytype: disable=attribute-error
107107 except UnicodeError :
108108 # Not a UTF-8 encoding.
109109 pass
110110
111111 # Try the filesystem encoding.
112112 try :
113- return string .decode (sys .getfilesystemencoding ())
113+ return string .decode (sys .getfilesystemencoding ()) # pytype: disable=attribute-error
114114 except UnicodeError :
115115 # string is not encoded for filesystem paths.
116116 pass
117117
118118 # Try the system default encoding.
119119 try :
120- return string .decode (sys .getdefaultencoding ())
120+ return string .decode (sys .getdefaultencoding ()) # pytype: disable=attribute-error
121121 except UnicodeError :
122122 # string is not encoded using the default encoding.
123123 pass
@@ -137,7 +137,7 @@ def Decode(data, encoding=None):
137137 # string = '\xdc'
138138 # string = string.decode('iso-8859-1')
139139 # string = string.encode('ascii', 'backslashreplace')
140- return string .decode ('iso-8859-1' )
140+ return string .decode ('iso-8859-1' ) # pytype: disable=attribute-error
141141
142142
143143def GetEncodedValue (env , name , default = None ):
0 commit comments