Skip to content

Commit a652175

Browse files
committed
Improve setup.py compilemessages
1 parent 1d28876 commit a652175

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Diff for: setup.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,13 @@
99

1010
# When creating the sdist, make sure the django.mo file also exists:
1111
if 'sdist' in sys.argv or 'develop' in sys.argv:
12+
os.chdir('fluent_faq')
1213
try:
13-
os.chdir('fluent_faq')
14-
15-
from django.core.management.commands.compilemessages import Command
16-
command = Command()
17-
command.execute(stdout=sys.stderr, verbosity=1)
14+
from django.core import management
15+
management.call_command('compilemessages', stdout=sys.stderr, verbosity=1)
1816
except ImportError:
19-
# < Django 1.7
20-
from django.core.management.commands.compilemessages import compile_messages
21-
compile_messages(sys.stderr)
17+
if 'sdist' in sys.argv:
18+
raise
2219
finally:
2320
os.chdir('..')
2421

0 commit comments

Comments
 (0)