Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
  • Loading branch information
dalthviz and ccordoba12 authored Oct 25, 2023
1 parent f749902 commit 13d92ae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spyder/config/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,18 +562,22 @@ def remove_option(self, section, option):
if isinstance(option, tuple):
# The actual option saved in the config
base_option = option[0]

# Keys of the nested dicts where the option to remove is contained
intermediate_options = option[1:-1]

# Key of the option to remove
last_option = option[-1]

# Get config value (which is a dictionary)
base_conf = self.get(section, base_option)

# Get reference to the actual dictionary containing the option
# that needs to be removed
conf_ptr = base_conf
for opt in intermediate_options:
conf_ptr = conf_ptr[opt]

# Remove option and set updated config values for the actual option
# while checking that the option to be removed is actually a value
# available in the config.
Expand Down

0 comments on commit 13d92ae

Please sign in to comment.