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.
This commit is contained in:
Martin Pitt 2016-12-12 11:37:42 +01:00
parent fadcea4995
commit 1a53882811
3 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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):