Replace all instances of EnvironmentError with OSError
According to the text just above https://docs.python.org/3/library/exceptions.html#EnvironmentError, `EnvironmentError` has been an alias of `OSError` since Python 3.3. Replacing it makes the code more consistent since `OSError` is used in other places in the code too.
This commit is contained in:
@@ -17,9 +17,9 @@ if False:
|
||||
os.makedirs(dest)
|
||||
os.chdir(dest)
|
||||
dest = os.path.expanduser('~/.local/bin/kitty')
|
||||
with suppress(EnvironmentError):
|
||||
with suppress(OSError):
|
||||
os.remove(dest)
|
||||
with suppress(EnvironmentError):
|
||||
with suppress(OSError):
|
||||
os.makedirs(os.path.dirname(dest))
|
||||
subprocess.check_call(['tar', 'xJf', tarball])
|
||||
os.symlink(os.path.abspath('bin/kitty'), dest)
|
||||
|
||||
Reference in New Issue
Block a user