Skip to content

Commit

Permalink
py2: urllib cross compatibility hack
Browse files Browse the repository at this point in the history
  • Loading branch information
Liz4v committed Sep 18, 2015
1 parent dbe10a2 commit a43fb57
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pyoneall/connection.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit a43fb57

Please sign in to comment.