diff --git a/python2/homesfr.py b/python2/homesfr.py index 0ff1b5f..26b28e5 100644 --- a/python2/homesfr.py +++ b/python2/homesfr.py @@ -211,8 +211,10 @@ class HomeSFR (Common): self.autologin = False if cookies == None: self.cookies = CookieJar () - else: + elif type (cookies) == CookieJar: self.cookies = cookies + else: + raise TypeError ('Cookies must be CookieJar type.') self.opener = request.build_opener (request.HTTPCookieProcessor (self.cookies)) def __str__ (self): diff --git a/python3/homesfr.py b/python3/homesfr.py index 0040734..4365075 100644 --- a/python3/homesfr.py +++ b/python3/homesfr.py @@ -207,8 +207,10 @@ class HomeSFR (Common): self.autologin = False if cookies == None: self.cookies = CookieJar () - else: + elif type (cookies) == CookieJar: self.cookies = cookies + else: + raise TypeError ('Cookies must be CookieJar type.') self.opener = request.build_opener (request.HTTPCookieProcessor (self.cookies)) def __str__ (self):