Skip to content

Commit 23404cd

Browse files
committed
Fixed #4899 -- Fixed a problem with PO file header generation caused by [5708].
Thanks, Ramiro Morales. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5722 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent c92ce31 commit 23404cd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

django/bin/make-messages.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import os
1010
import sys
1111
import getopt
12+
from itertools import dropwhile
1213

1314
pythonize_re = re.compile(r'\n\s*//')
1415

@@ -118,7 +119,7 @@ def make_messages():
118119
msgs = msgs.replace(old, new)
119120
if os.path.exists(potfile):
120121
# Strip the header
121-
msgs = '\n'.join(msgs.split('\n')[17:])
122+
msgs = '\n'.join(dropwhile(len, msgs.split('\n')))
122123
else:
123124
msgs = msgs.replace('charset=CHARSET', 'charset=UTF-8')
124125
if msgs:

0 commit comments

Comments
 (0)