python-2.6-gettext-plurals
authorAnas Nashif <anas.nashif@intel.com>
Wed, 7 Nov 2012 15:29:36 +0000 (07:29 -0800)
committerChanho Park <chanho61.park@samsung.com>
Tue, 19 Aug 2014 10:37:01 +0000 (19:37 +0900)
===================================================================

Lib/gettext.py

index 3f4758034c5283a0ef40eea53284fae61b19fc7d..146b19aa5865408f9d7fb3e77a4043d4189d3fd3 100644 (file)
@@ -311,8 +311,9 @@ class GNUTranslations(NullTranslations):
                         self._charset = v.split('charset=')[1]
                     elif k == 'plural-forms':
                         v = v.split(';')
-                        plural = v[1].split('plural=')[1]
-                        self.plural = c2py(plural)
+                        if len(v) > 1:
+                            plural = v[1].split('plural=')[1]
+                            self.plural = c2py(plural)
             # Note: we unconditionally convert both msgids and msgstrs to
             # Unicode using the character encoding specified in the charset
             # parameter of the Content-Type header.  The gettext documentation