Commit 6b77b36f authored by Richard's avatar Richard Committed by GitHub

Merge pull request #4 from richardARPANET/py2-fix

python 2 setup.py compat fix
parents 40b823d0 35df2583
...@@ -6,7 +6,9 @@ Release History ...@@ -6,7 +6,9 @@ Release History
5.4.4 (unreleased) 5.4.4 (unreleased)
++++++++++++++++++ ++++++++++++++++++
- Nothing changed yet. - Python 2.x setup.py bugfix.
- Bugfix for ``title_exists`` method returning ``None``.
- Bugfix for ``get_title`` raising an incorrect exception when redirection title.
5.4.3 (2018-04-05) 5.4.3 (2018-04-05)
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
from __future__ import absolute_import from __future__ import absolute_import
import os import os
from codecs import open
from setuptools import find_packages, setup from setuptools import find_packages, setup
......
...@@ -103,9 +103,9 @@ class Imdb(Auth): ...@@ -103,9 +103,9 @@ class Imdb(Auth):
def title_exists(self, imdb_id): def title_exists(self, imdb_id):
self.validate_imdb_id(imdb_id) self.validate_imdb_id(imdb_id)
page_url = 'http://www.imdb.com/title/{0}/'.format(imdb_id) page_url = 'https://www.imdb.com/title/{0}/'.format(imdb_id)
response = self.session.head(page_url) response = self.session.get(page_url, allow_redirects=False)
if response.status_code == httplib.OK: if response.status_code == httplib.OK:
return True return True
...@@ -298,8 +298,8 @@ class Imdb(Auth): ...@@ -298,8 +298,8 @@ class Imdb(Auth):
def is_redirection_title(self, imdb_id): def is_redirection_title(self, imdb_id):
self.validate_imdb_id(imdb_id) self.validate_imdb_id(imdb_id)
page_url = 'http://www.imdb.com/title/{0}/'.format(imdb_id) page_url = 'https://www.imdb.com/title/{0}/'.format(imdb_id)
response = self.session.head(page_url) response = self.session.get(page_url, allow_redirects=False)
if response.status_code == httplib.MOVED_PERMANENTLY: if response.status_code == httplib.MOVED_PERMANENTLY:
return True return True
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment