From fbafa9c847ee24d1035ce972fcea09476d6d0795 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Fri, 5 Jun 2020 16:22:31 -0700 Subject: [PATCH] PYTHON-2138 Fix NameError: name 'AwsSaslContext' is not defined --- pymongo/auth_aws.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pymongo/auth_aws.py b/pymongo/auth_aws.py index e57bec324..ff07a12e7 100644 --- a/pymongo/auth_aws.py +++ b/pymongo/auth_aws.py @@ -21,6 +21,9 @@ try: PyMongoAuthAwsError) _HAVE_MONGODB_AWS = True except ImportError: + class AwsSaslContext(object): + def __init__(self, credentials): + pass _HAVE_MONGODB_AWS = False import bson