Merge pull request #83 from SakuraSound/fix-migrate-unlink

Catch OSError (if read-only file system)
This commit is contained in:
long2ice 2020-11-18 15:40:29 +08:00 committed by GitHub
commit 5760fe2040
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,7 +64,7 @@ class Migrate:
def remove_old_model_file(cls, app: str, location: str): def remove_old_model_file(cls, app: str, location: str):
try: try:
os.unlink(cls.get_old_model_file(app, location)) os.unlink(cls.get_old_model_file(app, location))
except FileNotFoundError: except (OSError, FileNotFoundError):
pass pass
@classmethod @classmethod