[Python-Dev] self._backupfilename in fileinput (original) (raw)

Skip Montanaro skip@pobox.com
Mon, 25 Mar 2002 16:13:02 -0600


Working my way through the unqualified except: clauses, I found one in fileinput.py that looks very straightforward:

try: os.unlink(backupfilename)
except: pass

To make sure that OSError was all that could be raised I started looking at what values backupfilename could assume. Then I started looking at self._backupfilename. This weird beast takes on values of three distinct types: None, 0, and various strings.

While it's not technically broken, is this something worth fixing? My inclination is to just add OSError to the except clause and let someone else worry about fixing something that's ugly but not really broken.

Skip