Skip to content

Commit

Permalink
set HTTP timeout long enough for wild keyword searches
Browse files Browse the repository at this point in the history
  • Loading branch information
willamowius committed Aug 5, 2021
1 parent 4811da8 commit 065218b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions eansearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def barcodePrefixSearch(self, prefix, page=0, lang=1):
def _urlopen(self, url):
if (sys.version_info >= (3,)):
import urllib.request
return urllib.request.urlopen(url).read().decode("utf-8")
return urllib.request.urlopen(url, timeout=180).read().decode("utf-8")
else:
import urllib2
return urllib2.urlopen(url).read().decode("utf-8")
return urllib2.urlopen(url, timeout=180).read().decode("utf-8")

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
description='A Python class for EAN and ISBN name lookup and validation using the API on ean-search.org',
long_description=long_description,
long_description_content_type="text/markdown",
version='1.3.0',
version='1.4.0',
url='https://github.com/eansearch/python-ean-search',
author='Jan Willamowius',
author_email='[email protected]',
Expand Down

0 comments on commit 065218b

Please sign in to comment.