Skip to content

Commit 7aecf71

Browse files
committed
Merge pull request #11 from snarfed/master
fix bug introduced by f29879a
2 parents 0b42311 + 4c95e16 commit 7aecf71

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

webmentiontools/send.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4+
import itertools
45
import urlparse
56
import re
67
import requests
@@ -50,11 +51,10 @@ def _discoverEndpoint(self):
5051
html = r.text
5152
soup = BeautifulSoup(html)
5253
tag = None
53-
for name in 'link', 'a':
54-
for rel in 'webmention', 'http://webmention.org/':
55-
tag = soup.find(name, attrs={'rel': rel})
56-
if tag:
57-
break
54+
for name, rel in itertools.product(('link', 'a'), ('webmention', 'http://webmention.org/')):
55+
tag = soup.find(name, attrs={'rel': rel})
56+
if tag:
57+
break
5858

5959
if tag and tag.get('href'):
6060
# add the base scheme and host to relative endpoints

0 commit comments

Comments
 (0)