Merge lp:~stefanor/pylibravatar/no-server into lp:pylibravatar

Proposed by Stefano Rivera on 2016-02-07
Status: Merged
Merged at revision: 42
Proposed branch: lp:~stefanor/pylibravatar/no-server
Merge into: lp:pylibravatar
Diff against target: 14 lines (+4/-0)
1 file modified
libravatar.py (+4/-0)
To merge this branch: bzr merge lp:~stefanor/pylibravatar/no-server
Reviewer Review Type Date Requested Status
Fran├žois Marier 2016-02-07 Approve on 2016-02-15
Review via email: mp+285291@code.launchpad.net

Description of the change

Ran into this while hacking on a project using libravatar, on a plane.

Sometimes you don't have DNS servers available :)

To post a comment you must log in.
Fran├žois Marier (fmarier) wrote :

Good idea, thanks for submitting a patch!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libravatar.py'
2--- libravatar.py 2015-08-02 18:20:02 +0000
3+++ libravatar.py 2016-02-07 10:01:46 +0000
4@@ -160,6 +160,10 @@
5 print("DNS Error: %s" % message)
6 return None
7
8+ if dns_request is None:
9+ # No servers discovered?
10+ return None
11+
12 if 'NXDOMAIN' == dns_request.header['status']:
13 # Not an error, but no point in going any further
14 return None

Subscribers

People subscribed via source and target branches