[Piuparts-commits] [piuparts] 16/17: *.py: fixup exception strings
Holger Levsen
holger at alioth.debian.org
Wed Nov 6 09:45:55 UTC 2013
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch develop
in repository piuparts.
commit e372334b79dc1cd4c573540b18a01152aedaf8c9
Author: Andreas Beckmann <anbe at debian.org>
Date: Wed Nov 6 01:21:22 2013 +0100
*.py: fixup exception strings
turn them into a single-element tuple to avoid creating a list of characters
Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
debian/changelog | 1 +
piuparts-master-backend.py | 4 ++--
piuparts-slave.py | 12 ++++++------
piupartslib/conf.py | 4 ++--
4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 9903c39..17065ea 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,6 +18,7 @@ piuparts (0.56) UNRELEASED; urgency=low
* piuparts-report.py:
- Report URLs of all Packages files used for a section.
- Avoid reporting duplicate dependencies after stripping versioning.
+ * Improve exception handling.
* known_problems: Upgrade adequate issue 'missing-copyright-file' from
boring to normal and make pre_remove_50_find_missing_copyright no longer
generate fatal errors.
diff --git a/piuparts-master-backend.py b/piuparts-master-backend.py
index c2f30fa..2784949 100644
--- a/piuparts-master-backend.py
+++ b/piuparts-master-backend.py
@@ -80,13 +80,13 @@ class Config(piupartslib.conf.Config):
class CommandSyntaxError(Exception):
def __init__(self, msg):
- self.args = msg
+ self.args = msg,
class ProtocolError(Exception):
def __init__(self):
- self.args = "EOF, missing space in long part, or other protocol error"
+ self.args = "EOF, missing space in long part, or other protocol error",
class Protocol:
diff --git a/piuparts-slave.py b/piuparts-slave.py
index 92f1fca..baa9de7 100644
--- a/piuparts-slave.py
+++ b/piuparts-slave.py
@@ -124,37 +124,37 @@ def sighup_handler(signum, frame):
class MasterIsBusy(Exception):
def __init__(self):
- self.args = "Master is busy, retry later"
+ self.args = "Master is busy, retry later",
class MasterNotOK(Exception):
def __init__(self):
- self.args = "Master did not respond with 'ok'"
+ self.args = "Master did not respond with 'ok'",
class MasterDidNotGreet(Exception):
def __init__(self):
- self.args = "Master did not start with 'hello'"
+ self.args = "Master did not start with 'hello'",
class MasterCommunicationFailed(Exception):
def __init__(self):
- self.args = "Communication with master failed"
+ self.args = "Communication with master failed",
class MasterIsCrazy(Exception):
def __init__(self):
- self.args = "Master said something unexpected"
+ self.args = "Master said something unexpected",
class MasterCantRecycle(Exception):
def __init__(self):
- self.args = "Master has nothing to recycle"
+ self.args = "Master has nothing to recycle",
class Slave:
diff --git a/piupartslib/conf.py b/piupartslib/conf.py
index 3d1c24c..1b18b51 100644
--- a/piupartslib/conf.py
+++ b/piupartslib/conf.py
@@ -33,14 +33,14 @@ class MissingSection(Exception):
def __init__(self, filename, section):
self.args = "Section %s not defined in configuration file %s" % \
- (section, filename)
+ (section, filename),
class MissingMandatorySetting(Exception):
def __init__(self, filename, key):
self.args = "Value for %s not set in configuration file %s" % \
- (key, filename)
+ (key, filename),
class Config(UserDict.UserDict):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git
More information about the Piuparts-commits
mailing list