diff --git a/cleanup.py b/cleanup.py index 7e693b3a2..469707ee1 100644 --- a/cleanup.py +++ b/cleanup.py @@ -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