Merge lp:~laney/software-center/1510237 into lp:software-center

Proposed by Iain Lane
Status: Merged
Merged at revision: 3342
Proposed branch: lp:~laney/software-center/1510237
Merge into: lp:software-center
Diff against target: 21 lines (+8/-3)
1 file modified
softwarecenter/region.py (+8/-3)
To merge this branch: bzr merge lp:~laney/software-center/1510237
Reviewer Review Type Date Requested Status
software-store-developers Pending
Review via email: mp+283181@code.launchpad.net

Commit message

Patch from Robin van der Vilet to not crash on locales with no country.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'softwarecenter/region.py'
--- softwarecenter/region.py 2012-11-28 16:58:59 +0000
+++ softwarecenter/region.py 2016-01-19 17:06:50 +0000
@@ -111,9 +111,14 @@
111 return res111 return res
112 if not loc:112 if not loc:
113 return res113 return res
114 countrycode = loc.split("_")[1]114
115 res["countrycode"] = countrycode115 try:
116 res["country"] = get_region_name(countrycode)116 countrycode = loc.split("_")[1]
117 res["countrycode"] = countrycode
118 res["country"] = get_region_name(countrycode)
119 except IndexError as e:
120 LOG.warn("Failed to get locale: '%s'" % e)
121
117 return res122 return res
118123
119 def _get_region_geoclue(self):124 def _get_region_geoclue(self):