[merge] tighten up some exception blocks
Alexander Belchenko
bialix at ukr.net
Thu Aug 9 12:21:36 BST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
(Sorry, previous mail contains incorrect bb: vote)
bb:comment
Martin Pool пишет:
> This fixes some try/except blocks that catch all exceptions unnecessarily.
> === modified file 'bzrlib/knit.py'
> --- bzrlib/knit.py 2007-03-09 22:17:39 +0000
> +++ bzrlib/knit.py 2007-05-12 19:05:12 +0000
> @@ -1468,7 +1468,7 @@
> df = GzipFile(mode='rb', fileobj=StringIO(raw_data))
> try:
> rec = self._check_header(version_id, df.readline())
> - except Exception, e:
> + except (IOException, ), e:
> raise KnitCorrupt(self._filename,
> "While reading {%s} got %s(%s)"
> % (version_id, e.__class__.__name__, str(e)))
^-- What is IOException here? I did not found any in bzrlib/errors.py.
Probably it should be IOError?
[µ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGuvjAzYr338mxwCURApcRAJwIvF463ko9mrOyQxutOFy6UtNzWgCfdOkp
xBKGZpFmjOVc0Dg/bRLQSI4=
=6Cb/
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list