mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 02:26:53 -07:00
Fix IOError on cleanup when git not found
On posix systems IOError is raised when git is not found In Python 3 IOError is an alias for OSError. In Python 2 IOError is not caught by OSError so we must catch both. Fixes #1460
This commit is contained in:
parent
da2c758024
commit
d3d1868021
1 changed files with 2 additions and 2 deletions
|
@ -53,7 +53,7 @@ def clean_bytecode():
|
|||
print(result)
|
||||
except subprocess.CalledProcessError as error:
|
||||
sys.exit('Error Code: {}'.format(error.returncode))
|
||||
except OSError as error:
|
||||
except (IOError, OSError) as error:
|
||||
sys.exit('Error: {}'.format(error))
|
||||
else:
|
||||
return result
|
||||
|
@ -70,7 +70,7 @@ def clean_folders(*paths):
|
|||
)
|
||||
except subprocess.CalledProcessError as error:
|
||||
sys.exit('Error Code: {}'.format(error.returncode))
|
||||
except OSError as error:
|
||||
except (IOError, OSError) as error:
|
||||
sys.exit('Error: {}'.format(error))
|
||||
else:
|
||||
return result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue