diff --git a/embedly/__init__.py b/embedly/__init__.py index 11f965c..ab5d75f 100644 --- a/embedly/__init__.py +++ b/embedly/__init__.py @@ -1,4 +1,4 @@ from __future__ import absolute_import from .client import Embedly -__version__ = '0.5.0.post0' +__version__ = '0.5.0.post1' diff --git a/embedly/client.py b/embedly/client.py index 3aff738..1dc5c5d 100644 --- a/embedly/client.py +++ b/embedly/client.py @@ -8,7 +8,12 @@ import re import httplib2 import json -from urllib import quote, urlencode +try: + # Python 3 + from urllib.parse import quote, urlencode +except ImportError: + # Python 2 + from urllib import quote, urlencode from .models import Url @@ -142,8 +147,8 @@ def _get(self, version, method, url_or_urls, **kwargs): 'error_code': int(resp['status'])} if multi: - return map(lambda url, data: Url(data, method, url), - url_or_urls, data) + return list(map(lambda url, data: Url(data, method, url), + url_or_urls, data)) return Url(data, method, url_or_urls) diff --git a/setup.py b/setup.py index e0fef44..73ed039 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ def get_version(): tests_require=tests_require, test_suite="embedly.tests", zip_safe=True, - use_2to3=True, + # Removed use_2to3=True for Python 3.12 compatibility classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', @@ -50,9 +50,12 @@ def get_version(): 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.3', - ] + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + ], + python_requires='>=3.8', )