From f1da44e477b737443a22151aaf7304e77c2a2ae4 Mon Sep 17 00:00:00 2001 From: "ederson.brilhante" Date: Tue, 29 May 2018 17:47:05 -0300 Subject: [PATCH] Add imports in rest.py --- .pre-commit-config.yaml | 2 +- networkapiclient/__init__.py | 2 +- networkapiclient/rest.py | 11 +++++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ac283c3..be30307 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,7 +30,7 @@ hooks: - id: reorder-python-imports language_version: python2.7 -- repo: git://github.com/pre-commit/mirrors-autopep8 +- repo: https://github.com/pre-commit/mirrors-autopep8 sha: 726322761e33581fcc0886d49a693945dece8594 hooks: - id: autopep8 diff --git a/networkapiclient/__init__.py b/networkapiclient/__init__.py index c3e2d1b..e4d4bd9 100644 --- a/networkapiclient/__init__.py +++ b/networkapiclient/__init__.py @@ -16,5 +16,5 @@ MAJOR_VERSION = '0' MINOR_VERSION = '8' -PATCH_VERSION = '5' +PATCH_VERSION = '8' VERSION = '.'.join((MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION,)) diff --git a/networkapiclient/rest.py b/networkapiclient/rest.py index 3576767..223b1d4 100644 --- a/networkapiclient/rest.py +++ b/networkapiclient/rest.py @@ -17,14 +17,21 @@ from networkapiclient.xml_utils import dumps_networkapi from networkapiclient.xml_utils import loads + +try: + from urllib2 import * +except: + from urllib.request import * + try: from urlparse import urlparse except: from urllib.parse import urlparse + try: - from urllib2 import * + from httplib import * except: - from urllib.request import * + from http.client import * LOG = logging.getLogger('networkapiclient.rest')