summaryrefslogtreecommitdiff
path: root/babel
diff options
context:
space:
mode:
authorAarni Koskela <akx@iki.fi>2023-01-11 10:42:08 +0200
committerGitHub <noreply@github.com>2023-01-11 10:42:08 +0200
commit61097845764f5a6afc2251172168e1b1732b290f (patch)
tree4fe79ad51cd414a022644c94013c770576a0206f /babel
parent338bfa13c39df0837dd45cf492eb24d8d214ba96 (diff)
downloadbabel-61097845764f5a6afc2251172168e1b1732b290f.tar.gz
Enable pre-commit (#943)
* Update pre-commit config syntax * CI: run pre-commit * CI: set up pip caching
Diffstat (limited to 'babel')
-rw-r--r--babel/messages/pofile.py2
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