Bug 914394 - Handle WindowsError on non-Windows; r=ted

This commit is contained in:
Gregory Szorc 2013-09-10 09:03:43 -07:00
Родитель 946af7a12e
Коммит 0dfbdd1ca3
1 изменённых файлов: 9 добавлений и 8 удалений

Просмотреть файл

@ -480,14 +480,15 @@ class Build(MachCommandBase):
try:
self.remove_objdir()
return 0
except WindowsError as e:
if e.winerror in (5, 32):
self.log(logging.ERROR, 'file_access_error', {'error': e},
"Could not clobber because a file was in use. If the "
"application is running, try closing it. {error}")
return 1
else:
raise
except OSError as e:
if sys.platform.startswith('win'):
if isinstance(e, WindowsError) and e.winerror in (5,32):
self.log(logging.ERROR, 'file_access_error', {'error': e},
"Could not clobber because a file was in use. If the "
"application is running, try closing it. {error}")
return 1
raise
@CommandProvider