Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit cea277ce authored by Markus Heiser's avatar Markus Heiser Committed by GitHub
Browse files

Merge pull request #2452 from return42/fix-2434

[fix] ClientPref - don't raise exception if Accept-Language is invalid
parents 73c023bb bc647fab
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -331,8 +331,12 @@ class ClientPref:
            except (ValueError, babel.core.UnknownLocaleError):
                continue
            pairs.append((locale, qvalue))

        locale = None
        if pairs:
            pairs.sort(reverse=True, key=lambda x: x[1])
        return cls(locale=pairs[0][0])
            locale = pairs[0][0]
        return cls(locale=locale)


class Preferences: