python/python-2.6-gettext-plurals.patch
OBS User autobuild b557378c0d Accepting request 30832 from devel:languages:python:Factory
Copy from devel:languages:python:Factory/python based on submit request 30832 from user matejcik

OBS-URL: https://build.opensuse.org/request/show/30832
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python?expand=0&rev=42
2010-01-29 17:51:47 +00:00

17 lines
849 B
Diff

Index: Lib/gettext.py
===================================================================
--- Lib/gettext.py.orig
+++ Lib/gettext.py
@@ -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