diff options
Diffstat (limited to 'babel/messages/pofile.py')
-rw-r--r-- | babel/messages/pofile.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/babel/messages/pofile.py b/babel/messages/pofile.py index a213b22..b366ccb 100644 --- a/babel/messages/pofile.py +++ b/babel/messages/pofile.py @@ -575,7 +575,7 @@ def write_po(fileobj, catalog, width=76, no_location=False, omit_header=False, # if no sorting possible, leave unsorted. # (see issue #606) try: - locations = sorted(message.locations, + locations = sorted(message.locations, key=lambda x: (x[0], isinstance(x[1], int) and x[1] or -1)) except TypeError: # e.g. "TypeError: unorderable types: NoneType() < int()" locations = message.locations |