File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -690,7 +690,7 @@ def get_validated_options(options, warn=True):
690690
691691 :Parameters:
692692 - `opts`: A dict of MongoDB URI options.
693- - `warn` (optional): If ``True`` then warnigns will be logged and
693+ - `warn` (optional): If ``True`` then warnings will be logged and
694694 invalid options will be ignored. Otherwise, invalid options will
695695 cause errors.
696696 """
@@ -716,11 +716,12 @@ def _handle_option_deprecations(options):
716716 options dictionary. Removes deprecated option key, value pairs if the
717717 options dictionary is found to also have the renamed option."""
718718 undeprecated_options = {}
719+ lc_optnames = [n .lower () for n in options ]
719720 for key , value in iteritems (options ):
720721 optname = str (key ).lower ()
721722 if optname in URI_OPTIONS_DEPRECATION_MAP :
722723 renamed_key = URI_OPTIONS_DEPRECATION_MAP [optname ]
723- if any ( renamed_key .lower () == n . lower () for n in options ) :
724+ if renamed_key .lower () in lc_optnames :
724725 warnings .warn ("Deprecated option '%s' ignored in favor of "
725726 "'%s'." % (str (key ), renamed_key ))
726727 continue
You can’t perform that action at this time.
0 commit comments