Skip to content

Commit

Permalink
Add Python 3.11 and Python 3.12 to setup.py; disable=attribute-error
Browse files Browse the repository at this point in the history
  • Loading branch information
dbieber committed Feb 24, 2024
1 parent e4d8fb1 commit c74e17c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fire/console/encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ def Decode(data, encoding=None):

try:
# Just return the string if its pure ASCII.
return string.decode('ascii')
return string.decode('ascii') # pytype: disable=attribute-error
except UnicodeError:
# The string is not ASCII encoded.
pass

# Try the suggested encoding if specified.
if encoding:
try:
return string.decode(encoding)
return string.decode(encoding) # pytype: disable=attribute-error
except UnicodeError:
# Bad suggestion.
pass
Expand All @@ -103,21 +103,21 @@ def Decode(data, encoding=None):
# be exceptional if a valid extended ascii encoding with extended chars
# were also a valid UITF-8 encoding.
try:
return string.decode('utf8')
return string.decode('utf8') # pytype: disable=attribute-error
except UnicodeError:
# Not a UTF-8 encoding.
pass

# Try the filesystem encoding.
try:
return string.decode(sys.getfilesystemencoding())
return string.decode(sys.getfilesystemencoding()) # pytype: disable=attribute-error
except UnicodeError:
# string is not encoded for filesystem paths.
pass

# Try the system default encoding.
try:
return string.decode(sys.getdefaultencoding())
return string.decode(sys.getdefaultencoding()) # pytype: disable=attribute-error
except UnicodeError:
# string is not encoded using the default encoding.
pass
Expand All @@ -137,7 +137,7 @@ def Decode(data, encoding=None):
# string = '\xdc'
# string = string.decode('iso-8859-1')
# string = string.encode('ascii', 'backslashreplace')
return string.decode('iso-8859-1')
return string.decode('iso-8859-1') # pytype: disable=attribute-error


def GetEncodedValue(env, name, default=None):
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',

'Operating System :: OS Independent',
'Operating System :: POSIX',
Expand Down

0 comments on commit c74e17c

Please sign in to comment.