Skip to content

Fix SyntaxWarning in GtkSettingsEditor._get_keyfile#13350

Open
leigh123linux wants to merge 1 commit intomasterfrom
leigh123linux-patch-3
Open

Fix SyntaxWarning in GtkSettingsEditor._get_keyfile#13350
leigh123linux wants to merge 1 commit intomasterfrom
leigh123linux-patch-3

Conversation

@leigh123linux
Copy link
Member

Move return statement out of finally block to eliminate SyntaxWarning.
The finally block served no cleanup purpose and has been removed.

Move return statement out of finally block to eliminate SyntaxWarning.
The finally block served no cleanup purpose and has been removed.
@leigh123linux
Copy link
Member Author

$ cinnamon-settings
KeybindingWidgets session type: x11
/usr/share/cinnamon/cinnamon-settings/bin/CinnamonGtkSettings.py:44: SyntaxWarning: 'return' in a 'finally' block
  return keyfile
Using pam module (python3-pampy)

pass
finally:

return keyfile
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to unindent this line - otherwise this method will only ever return None (on error) or fall through and also return nothing.

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