Python 3.2 workaround: Replace FileNotFoundError with {IO,OS}Error

The FileNotFound class is not yet available in Python 3.2, but as long as
snakefruit still runs Ubuntu 12.04 we need to get along without it.
master
Martin Pitt 8 years ago
parent fadcea4995
commit 1a53882811

@ -480,7 +480,7 @@ class Britney(object):
try:
release_file = read_release_file(self.suite_info['testing'].path)
self.log("Found a Release file in testing - using that for defaults")
except FileNotFoundError:
except IOError:
self.log("Testing does not have a Release file.")
release_file = None

@ -320,7 +320,7 @@ class AgePolicy(BasePolicy):
dates[l[0]] = (l[1], int(l[2]))
except ValueError:
pass
except FileNotFoundError:
except IOError:
if not using_new_name:
# If we using the legacy name, then just give up
raise

@ -660,7 +660,7 @@ def possibly_compressed(path, permitted_compressesion=None):
cpath = "%s.%s" % (path, ext)
if os.path.exists(cpath):
return cpath
raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), path)
raise OSError(errno.ENOENT, os.strerror(errno.ENOENT), path)
def create_provides_map(packages):

Loading…
Cancel
Save