File tree 1 file changed +3
-2
lines changed
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):
690
690
691
691
:Parameters:
692
692
- `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
694
694
invalid options will be ignored. Otherwise, invalid options will
695
695
cause errors.
696
696
"""
@@ -716,11 +716,12 @@ def _handle_option_deprecations(options):
716
716
options dictionary. Removes deprecated option key, value pairs if the
717
717
options dictionary is found to also have the renamed option."""
718
718
undeprecated_options = {}
719
+ lc_optnames = [n .lower () for n in options ]
719
720
for key , value in iteritems (options ):
720
721
optname = str (key ).lower ()
721
722
if optname in URI_OPTIONS_DEPRECATION_MAP :
722
723
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 :
724
725
warnings .warn ("Deprecated option '%s' ignored in favor of "
725
726
"'%s'." % (str (key ), renamed_key ))
726
727
continue
You can’t perform that action at this time.
0 commit comments