Skip to content

Commit e9341fe

Browse files
committed
Fix compilemessages call for setup.py
1 parent 5b9acd1 commit e9341fe

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

setup.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
#!/usr/bin/env python
2+
import os
3+
import sys
4+
5+
from setuptools import find_packages, setup
6+
7+
# When creating the sdist, make sure the django.mo file also exists:
8+
if "sdist" in sys.argv or "develop" in sys.argv:
9+
os.chdir("polymorphic")
10+
try:
11+
from django.core import management
12+
13+
management.call_command("compilemessages", stdout=sys.stderr, verbosity=1)
14+
except ImportError:
15+
if "sdist" in sys.argv:
16+
raise
17+
finally:
18+
os.chdir("..")
219

320
from setuptools import setup
421

0 commit comments

Comments
 (0)