i18n/polib.py
changeset 24306 6ddc86eedc3b
parent 23139 e53f6b72a0e4
child 25660 328739ea70c3
--- a/i18n/polib.py	Fri Mar 13 14:20:13 2015 -0400
+++ b/i18n/polib.py	Fri Mar 13 17:00:06 2015 -0400
@@ -437,8 +437,15 @@
         # the keys are sorted in the .mo file
         def cmp(_self, other):
             # msgfmt compares entries with msgctxt if it exists
-            self_msgid = _self.msgctxt and _self.msgctxt or _self.msgid
-            other_msgid = other.msgctxt and other.msgctxt or other.msgid
+            if _self.msgctxt:
+                self_msgid = _self.msgctxt
+            else:
+                self_msgid = _self.msgid
+
+            if other.msgctxt:
+                other_msgid = other.msgctxt
+            else:
+                other_msgid = other.msgid
             if self_msgid > other_msgid:
                 return 1
             elif self_msgid < other_msgid: