Fix deprecation warnings

This commit is contained in:
Cristi Vîjdea
2018-12-21 15:55:30 +02:00
parent 01391ca9eb
commit bfd13668cc
7 changed files with 30 additions and 11 deletions
@@ -158,6 +158,7 @@ class Command(BaseCommand):
else:
# normally this would be easily done with open(mode='x'/'w'),
# but python 2 is a pain in the ass as usual
# TODO: simplify when dropping support for python 2.7
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: