From 1322d04c660325532fe6e2bd0aa10ab8a4693440 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 6 Jul 2014 05:34:29 +0400 Subject: [PATCH] Minor refactoring: rename msg to e --- Robots/bkmk_robot_base.py | 8 ++++---- Robots/bkmk_rurllib.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Robots/bkmk_robot_base.py b/Robots/bkmk_robot_base.py index 210d092..30a26bf 100644 --- a/Robots/bkmk_robot_base.py +++ b/Robots/bkmk_robot_base.py @@ -32,13 +32,13 @@ reloc_dict = { } -def get_error(msg): - if isinstance(msg, str): - return msg +def get_error(e): + if isinstance(e, str): + return e else: s = [] - for i in msg: + for i in e: s.append("'%s'" % str(i).replace('\n', "\\n")) return "(%s)" % ' '.join(s) diff --git a/Robots/bkmk_rurllib.py b/Robots/bkmk_rurllib.py index 9acbd88..e0d5c2c 100644 --- a/Robots/bkmk_rurllib.py +++ b/Robots/bkmk_rurllib.py @@ -102,13 +102,13 @@ class robot_urllib(robot_base): except RedirectException, e: return None, e.errcode, e.newurl, None, None - except IOError, msg: - if (msg[0] == "http error") and (msg[1] == -1): + except IOError, e: + if (e[0] == "http error") and (e[1] == -1): error = None bookmark.no_error = "The server did not return any header - it is not an error, actually" self.log(' no headers: %s' % bookmark.no_error) else: - error = get_error(msg) + error = get_error(e) self.log(' Error: %s' % error) return error, None, None, None, None -- 2.39.5