Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To fix the error of referencing a non-existent variable. #11737

Merged
merged 1 commit into from
Jul 4, 2023

Conversation

kacperpaczos
Copy link
Contributor

I added a condition in set_button_label because if we set has_button_label to False and then use set_button_label, we will encounter an exception.

kacper@kacper-VirtualBox:~$ cinnamon-settings themes
/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py:442: DeprecationWarning: Gtk.Window.set_wmclass is deprecated
self.window.set_wmclass(wm_class, wm_class)
Loading Themes module
/home/kacper/.local/share/themes does not exist! Skipping
Mint-Y-Sand
dupa
Traceback (most recent call last):
File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 793, in
window = MainWindow()
File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 314, in init
if self.load_sidepage_as_standalone():
File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 448, in load_sidepage_as_standalone
self.go_to_sidepage(sp_data.sp, user_action=False)
File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 174, in go_to_sidepage
sidePage.build()
File "/usr/share/cinnamon/cinnamon-settings/bin/SettingsWidgets.py", line 212, in build
self.module.on_module_selected()
File "/usr/share/cinnamon/cinnamon-settings/modules/cs_themes.py", line 187, in on_module_selected
self.icon_chooser = self.create_button_chooser(self.settings, 'icon-theme', 'icons', 'icons', button_picture_size=ICON_SIZE, menu_pictures_size=ICON_SIZE, num_cols=4)
File "/usr/share/cinnamon/cinnamon-settings/modules/cs_themes.py", line 722, in create_button_chooser
self.set_button_chooser(chooser, theme, path_prefix, path_suffix, button_picture_size)
File "/usr/share/cinnamon/cinnamon-settings/modules/cs_themes.py", line 726, in set_button_chooser
self.set_button_chooser_text(chooser, theme)
File "/usr/share/cinnamon/cinnamon-settings/modules/cs_themes.py", line 748, in set_button_chooser_text
chooser.set_button_label(theme)
File "/usr/share/cinnamon/cinnamon-settings/bin/ChooserButtonWidgets.py", line 135, in set_button_label
self.button_label.set_markup(label)
AttributeError: 'PictureChooserButton' object has no attribute 'button_label'. Did you mean: 'button_box'?
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] Nie ma takiego pliku ani katalogu: '/var/crash/_usr_share_cinnamon_cinnamon-settings_cinnamon-settings.py.1000.crash'

Original exception was:
Traceback (most recent call last):
File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 793, in
window = MainWindow()
File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 314, in init
if self.load_sidepage_as_standalone():
File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 448, in load_sidepage_as_standalone
self.go_to_sidepage(sp_data.sp, user_action=False)
File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 174, in go_to_sidepage
sidePage.build()
File "/usr/share/cinnamon/cinnamon-settings/bin/SettingsWidgets.py", line 212, in build
self.module.on_module_selected()
File "/usr/share/cinnamon/cinnamon-settings/modules/cs_themes.py", line 187, in on_module_selected
self.icon_chooser = self.create_button_chooser(self.settings, 'icon-theme', 'icons', 'icons', button_picture_size=ICON_SIZE, menu_pictures_size=ICON_SIZE, num_cols=4)
File "/usr/share/cinnamon/cinnamon-settings/modules/cs_themes.py", line 722, in create_button_chooser
self.set_button_chooser(chooser, theme, path_prefix, path_suffix, button_picture_size)
File "/usr/share/cinnamon/cinnamon-settings/modules/cs_themes.py", line 726, in set_button_chooser
self.set_button_chooser_text(chooser, theme)
File "/usr/share/cinnamon/cinnamon-settings/modules/cs_themes.py", line 748, in set_button_chooser_text
chooser.set_button_label(theme)
File "/usr/share/cinnamon/cinnamon-settings/bin/ChooserButtonWidgets.py", line 135, in set_button_label
self.button_label.set_markup(label)
AttributeError: 'PictureChooserButton' object has no attribute 'button_label'. Did you mean: 'button_box'?

@mtwebster mtwebster merged commit 9db3e00 into linuxmint:master Jul 4, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants