Browse files

Handle checking a hostname of .

  • Loading branch information...
1 parent e008423 commit 6c0950a49473f6e13812f2e41b325fb880158565 @rboulton committed Dec 5, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 fastpublicsuffix/publicsuffix.py
View
7 fastpublicsuffix/publicsuffix.py
@@ -23,10 +23,13 @@
def _normalize(s):
- s = s.strip().strip('.').split()[0].lower()
+ s = s.strip().strip('.').split()
+ if len(s) ==0:
+ return ''
+ s = s[0].lower()
try:
return s.decode('utf-8')
- except UnicodeEncodeError, ex:
+ except UnicodeEncodeError:
return s

0 comments on commit 6c0950a

Please sign in to comment.