diff --git a/gajim/chat_control_base.py b/gajim/chat_control_base.py index 0453f433a..340dfb279 100644 --- a/gajim/chat_control_base.py +++ b/gajim/chat_control_base.py @@ -497,7 +497,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): item = Gtk.SeparatorMenuItem.new() menu.prepend(item) - menu2 = self.prepare_context_menu() + menu2 = self.prepare_context_menu() # pylint: disable=assignment-from-none i = 0 for item in menu2: menu2.remove(item) diff --git a/gajim/common/optparser.py b/gajim/common/optparser.py index 09220b0b1..51f1622d7 100644 --- a/gajim/common/optparser.py +++ b/gajim/common/optparser.py @@ -113,14 +113,16 @@ class OptionsParser: app.config.foreach(self.write_line, file) except IOError: log.exception('Failed to write config file') - return + return False try: temp_filepath.replace(config_path) except Exception: log.exception('Failed to replace config file') - else: - log.info('Successful saved config file') + return False + + log.info('Successful saved config file') + return True def update_config(self, old_version, new_version): old_version_list = old_version.split('.') # convert '0.x.y' to (0, x, y) diff --git a/gajim/common/socks5.py b/gajim/common/socks5.py index 4c584652d..004b9e6a3 100644 --- a/gajim/common/socks5.py +++ b/gajim/common/socks5.py @@ -1297,8 +1297,7 @@ class Socks5Client(Socks5): return if self.state < 5: self.idlequeue.set_read_timeout(self.fd, CONNECT_TIMEOUT) - result = self.main(0) - self.queue.process_result(result, self) + self.main(0) elif self.state == 5: # wait for proxy reply pass elif self.file_props.type_ == 'r': diff --git a/gajim/gui_interface.py b/gajim/gui_interface.py index 9ef5e0989..d206d817e 100644 --- a/gajim/gui_interface.py +++ b/gajim/gui_interface.py @@ -2038,15 +2038,12 @@ class Interface: @staticmethod def save_config(): - err_str = parser.write() - if err_str is not None: - print(err_str, file=sys.stderr) - # it is good to notify the user - # in case he or she cannot see the output of the console - error_dialog = ErrorDialog(_('Could not save your settings and ' - 'preferences'), err_str) - error_dialog.run() - sys.exit() + if parser.write(): + return + + error_dialog = ErrorDialog( + _('Could not save your settings and preferences')) + error_dialog.run() @staticmethod def update_avatar(account=None, jid=None, contact=None, room_avatar=False): diff --git a/scripts/dev/pylint-ci.sh b/scripts/dev/pylint-ci.sh index 039286ac7..97ecfbcb1 100755 --- a/scripts/dev/pylint-ci.sh +++ b/scripts/dev/pylint-ci.sh @@ -1,7 +1,7 @@ #!/bin/sh PYLINT=${PYLINT:-pylint} -"$PYLINT" --disable=C0103,C0302,C0330,C0411,C0412,C0413,E0203,E0401,E0611,E0710,E0712,E1101,E1102,E1128,E1133,E1136,R0201,R0901,R0904,R0913,R0916,R1702,W0201,W0212,W0221,W0223,W0311,W0401,W0603,W0613,W0614 "$@" +"$PYLINT" --disable=C0103,C0302,C0330,C0411,C0412,C0413,E0203,E0401,E0611,E0710,E0712,E1101,E1102,E1133,E1136,R0201,R0901,R0904,R0913,R0916,R1702,W0201,W0212,W0221,W0223,W0311,W0401,W0603,W0613,W0614 "$@" # C0103 invalid-name # C0302 too-many-lines @@ -16,7 +16,6 @@ PYLINT=${PYLINT:-pylint} # E0712 catching-non-exception - GLib.GError is not recognized # E1101 no-member # E1102 not-callable -# E1128 assignment-from-none # E1133 not-an-iterable # E1136 unsubscriptable-object # R0201 no-self-use