Put finally: in their own block for Python 2.4

This commit is contained in:
Thomas Hurst 2008-09-03 19:34:20 +01:00
parent 8fd22efed2
commit 84658d4ea4
2 changed files with 10 additions and 8 deletions

View File

@ -74,10 +74,11 @@ class Uninstall(Command):
def run(self): def run(self):
self.ensure_filename('manifest') self.ensure_filename('manifest')
try: try:
f = open(self.manifest) try:
files = [file.strip() for file in f] f = open(self.manifest)
except IOError, e: files = [file.strip() for file in f]
raise DistutilsFileError("unable to open install manifest: %s", str(e)) except IOError, e:
raise DistutilsFileError("unable to open install manifest: %s", str(e))
finally: finally:
f.close() f.close()

View File

@ -167,10 +167,11 @@ class ConfigFile:
def _line_ok(self): def _line_ok(self):
if self._currvalue is None: return if self._currvalue is None: return
else: else:
try: try: # *glares at 2.4 users*
self.callback(self._currsection, self._currsetting, self._currvalue) try:
except ValueError, e: self.callback(self._currsection, self._currsetting, self._currvalue)
raise ConfigSyntaxError(str(e), self) except ValueError, e:
raise ConfigSyntaxError(str(e), self)
finally: finally:
self._currvalue = None self._currvalue = None