[merge] tighten up some exception blocks

Alexander Belchenko bialix at ukr.net
Thu Aug 9 09:35:32 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

bb: resubmit

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

iD8DBQFGutHTzYr338mxwCURAl8lAJ9TTV364UtngtDLtcBVNDuk397WdACeKkDg
ypbZgfqPM+NOLSy835p20Bw=
=/EgF
-----END PGP SIGNATURE-----



More information about the bazaar mailing list