PYTHON-4907 Avoid noisy TypeError at interpreter exit (#2005)

This commit is contained in:
Shane Harvey 2024-11-18 10:25:46 -08:00 committed by GitHub
parent 18940030f1
commit c9d9d7c2dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -1195,7 +1195,8 @@ class AsyncMongoClient(common.BaseObject, Generic[_DocumentType]):
ResourceWarning,
stacklevel=2,
)
except AttributeError:
except (AttributeError, TypeError):
# Ignore errors at interpreter exit.
pass
def _close_cursor_soon(

View File

@ -1193,7 +1193,8 @@ class MongoClient(common.BaseObject, Generic[_DocumentType]):
ResourceWarning,
stacklevel=2,
)
except AttributeError:
except (AttributeError, TypeError):
# Ignore errors at interpreter exit.
pass
def _close_cursor_soon(