Skip to content

Commit

Permalink
Merge 4930989 into 10dde62
Browse files Browse the repository at this point in the history
  • Loading branch information
allblackt committed Nov 13, 2015
2 parents 10dde62 + 4930989 commit bcaf052
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions bvc/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import socket

from six import string_types
from concurrent import futures
from collections import OrderedDict
try:
Expand Down Expand Up @@ -141,10 +142,12 @@ def fetch_last_version(self, package, allow_pre_releases,
socket.setdefaulttimeout(timeout)
try:
content = urlopen(package_json_url).read()
# in Python 3 urlopen returns bytes not str, thus needing decoding
results = json.loads(content if isinstance(content, string_types)
else content.decode('utf-8'))
except URLError as error:
content = '{"releases": []}'
results = {"releases": []}
logger.debug('!> %s %s' % (package_json_url, error.reason))
results = json.loads(content)
socket.setdefaulttimeout(None)
for version in specifier.filter(results['releases']):
version = parse_version(version)
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from setuptools import setup
from setuptools import find_packages

__version__ = '1.9.2'
__version__ = '1.9.3'
__license__ = 'BSD License'

__author__ = 'Fantomas42'
Expand Down Expand Up @@ -41,6 +41,7 @@
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'License :: OSI Approved :: BSD License',
'Topic :: Software Development :: Build Tools',
'Topic :: Software Development :: Libraries :: Python Modules'],
Expand Down

0 comments on commit bcaf052

Please sign in to comment.