diff --git a/pyoneall/connection.py b/pyoneall/connection.py index 4c62743..5cb9d71 100644 --- a/pyoneall/connection.py +++ b/pyoneall/connection.py @@ -1,13 +1,19 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals + +try: + from urllib.error import HTTPError + from urllib.request import Request, urlopen +except ImportError: + # https://github.com/PythonCharmers/python-future/issues/167 + from urllib2 import HTTPError, Request, urlopen + from future import standard_library standard_library.install_aliases() from base64 import standard_b64encode from json import dumps, loads -from urllib.error import HTTPError -from urllib.request import Request, urlopen from .base import OADict from .classes import Users, Connections, Connection, User, BadOneAllCredentials