Merge lp:~3v1n0/click/geoip-not-found-fix into lp:click

Proposed by Marco Trevisan (Treviño)
Status: Merged
Merged at revision: 458
Proposed branch: lp:~3v1n0/click/geoip-not-found-fix
Merge into: lp:click
Diff against target: 13 lines (+2/-1)
1 file modified
click/chroot.py (+2/-1)
To merge this branch: bzr merge lp:~3v1n0/click/geoip-not-found-fix
Reviewer Review Type Date Requested Status
Michael Vogt Approve
Review via email: mp+253246@code.launchpad.net

Commit message

Chroot: return CountryCode only if available

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks, this looks fine.

review: Approve
Revision history for this message
Michael Vogt (mvo) wrote :

This is merged into lp:click/devel now. Its not showing up as merged because the merge target is pointing to lp:click. If you adjust that it will show up as merged.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'click/chroot.py'
2--- click/chroot.py 2015-03-10 17:36:06 +0000
3+++ click/chroot.py 2015-03-17 17:40:03 +0000
4@@ -206,7 +206,8 @@
5 with urllib.request.urlopen(GEOIP_SERVER) as f:
6 xml_data = f.read()
7 et = ElementTree.fromstring(xml_data)
8- return et.find("CountryCode").text.lower()+"."
9+ cc = et.find("CountryCode")
10+ return cc.text.lower()+"." if cc else ""
11 except (ElementTree.ParseError, urllib.error.URLError):
12 pass
13 return ""

Subscribers

People subscribed via source and target branches