[Python-checkins] r54394 - in python/trunk: Lib/wave.py Misc/NEWS

Raymond Hettinger python at rcn.com
Thu Mar 15 08:48:08 CET 2007


> -        self.initfp(f)
> +        try:
> +            self.initfp(f)
> +        except:
> +            if self._i_opened_the_file:
> +                f.close()
> +            raise

Do you really want a bare except?
Would a try/finally approach work here?


Raymond


More information about the Python-checkins mailing list