From e6e0150e07be32b91624b460b67be39b8f6b0ab9 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Mon, 2 Jul 2012 08:05:06 +0200 Subject: Make exception syntax consistent --- gbp/pkg/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gbp/pkg') diff --git a/gbp/pkg/__init__.py b/gbp/pkg/__init__.py index 36f7099..d402f4e 100644 --- a/gbp/pkg/__init__.py +++ b/gbp/pkg/__init__.py @@ -175,13 +175,13 @@ class UpstreamSource(object): and determine the toplevel of the source tree. """ if self.is_dir(): - raise GbpError, "Cannot unpack directory %s" % self.path + raise GbpError("Cannot unpack directory %s" % self.path) if not filters: filters = [] if type(filters) != type([]): - raise GbpError, "Filters must be a list" + raise GbpError("Filters must be a list") self._unpack_archive(dir, filters) self.unpacked = self._unpacked_toplevel(dir) @@ -200,7 +200,7 @@ class UpstreamSource(object): try: gbpc.UnpackZipArchive(self.path, dir)() except gbpc.CommandExecFailed: - raise GbpError, "Unpacking of %s failed" % self.path + raise GbpError("Unpacking of %s failed" % self.path) def _unpacked_toplevel(self, dir): """unpacked archives can contain a leading directory or not""" @@ -236,13 +236,13 @@ class UpstreamSource(object): @rtype: UpstreamSource """ if not self.unpacked: - raise GbpError, "Need an unpacked source tree to pack" + raise GbpError("Need an unpacked source tree to pack") if not filters: filters = [] if type(filters) != type([]): - raise GbpError, "Filters must be a list" + raise GbpError("Filters must be a list") try: unpacked = self.unpacked.rstrip('/') -- cgit v1.2.3