Fix test_noop_inspectors

This commit is contained in:
Cristi Vîjdea
2017-12-27 20:23:21 +01:00
parent d39764d383
commit 22853b87c7
4 changed files with 24 additions and 6 deletions
@@ -126,6 +126,8 @@ class Command(BaseCommand):
if output_file == '-':
self.write_schema(schema, self.stdout, format)
else:
# normally this would be easily done with open(mode='x'/'w'),
# but python 2 is a pain in the ass as usual
flags = os.O_CREAT | os.O_WRONLY
flags = flags | (os.O_TRUNC if overwrite else os.O_EXCL)
with os.fdopen(os.open(output_file, flags), "w") as stream: