Permalink
Browse files

If next page is same as current, quit!

  • Loading branch information...
palfrey committed Jun 1, 2012
1 parent 29a66b5 commit b477aeaad964298347d46a7f2217971717d11f49
Showing with 4 additions and 2 deletions.
  1. +4 −2 books.py
View
@@ -83,9 +83,11 @@
</html>"""%(title, title, content))
if link != None:
link = link.groups()[0]
- page = urljoin(page, link)
- if page == None:
+ newpage = urljoin(page, link)
+ if page == None or newpage == page:
+ page = None
break
+ page = newpage
toc.write("""\t\t</div>
</body>
</html>""")

0 comments on commit b477aea

Please sign in to comment.