Use the errno library and not the literal error numbers.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-04-30 02:01:06 -04:00
parent b4d1ce33e5
commit d610f8d5f6

View File

@@ -1,5 +1,6 @@
from __future__ import unicode_literals
import errno
import os
from django.conf import settings
@@ -36,7 +37,7 @@ class Command(management.BaseCommand):
try:
os.makedirs(settings.MEDIA_ROOT)
except OSError as exception:
if exception.errno == 17 and force:
if exception.errno == errno.EEXIST and force:
pass
# Touch media/__init__.py