From c74e17cf6299b106ffbf684f9048d55d833cabe2 Mon Sep 17 00:00:00 2001 From: David Bieber Date: Sat, 24 Feb 2024 13:01:46 -0500 Subject: [PATCH] Add Python 3.11 and Python 3.12 to setup.py; disable=attribute-error --- fire/console/encoding.py | 12 ++++++------ setup.py | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/fire/console/encoding.py b/fire/console/encoding.py index 780e5a28..41bda634 100644 --- a/fire/console/encoding.py +++ b/fire/console/encoding.py @@ -86,7 +86,7 @@ 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 @@ -94,7 +94,7 @@ def Decode(data, encoding=None): # 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 @@ -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 @@ -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): diff --git a/setup.py b/setup.py index 3e5cc3b7..24e0e325 100644 --- a/setup.py +++ b/setup.py @@ -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',