Skip to content

SG-38306 Python2 Removal - Part 1 - Import order #398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions shotgun_api3/shotgun.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""

# Python 2/3 compatibility
from .lib import six
from .lib import sgsix
from .lib import sgutils
from .lib.six import BytesIO # used for attachment upload
from .lib.six.moves import map

from .lib.six.moves import http_cookiejar # used for attachment upload
import copy
import datetime
import json
import logging
import uuid # used for attachment upload
import os
import re
import copy
import shutil # used for attachment download
import ssl
import stat # used for attachment upload
import sys
import time
import json
import uuid # used for attachment upload

# Python 2/3 compatibility
from .lib import six
from .lib import sgsix
from .lib import sgutils
from .lib.six import BytesIO # used for attachment upload
from .lib.six.moves import map
from .lib.six.moves import http_cookiejar # used for attachment upload
from .lib.six.moves import urllib
import shutil # used for attachment download
from .lib.six.moves import http_client # Used for secure file upload.
from .lib.httplib2 import Http, ProxyInfo, socks, ssl_error_classes
from .lib.sgtimezone import SgTimezone
Expand Down
18 changes: 10 additions & 8 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,31 @@

from __future__ import print_function
import datetime
import sys
import glob
import os
from . import mock
from .mock import patch, MagicMock
import ssl
import sys
import time
import types
import uuid
import unittest
from shotgun_api3.lib.six.moves import range, urllib
import uuid
import warnings
import glob

import shotgun_api3
from shotgun_api3.lib.httplib2 import Http
from shotgun_api3.lib import six
from shotgun_api3.lib.httplib2 import Http

# To mock the correct exception when testion on Python 2 and 3, use the
# ShotgunSSLError variable from sgsix that contains the appropriate exception
# class for the current Python version.
from shotgun_api3.lib.sgsix import ShotgunSSLError

from shotgun_api3.lib.six.moves import range, urllib

import shotgun_api3

from . import base
from . import mock
from .mock import patch, MagicMock


class TestShotgunApi(base.LiveTestBase):
Expand Down
8 changes: 4 additions & 4 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@

import datetime
import os
import platform
import re
import sys
import time
import unittest

from shotgun_api3.lib.six.moves import urllib
from shotgun_api3.lib import six, sgutils
Expand All @@ -27,10 +31,6 @@
except ImportError:
import shotgun_api3.lib.simplejson as json

import platform
import sys
import time
import unittest
from . import mock

import shotgun_api3.lib.httplib2 as httplib2
Expand Down
1 change: 1 addition & 0 deletions tests/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import os
import unittest
from unittest import mock

from .mock import patch
import shotgun_api3 as api
from shotgun_api3.shotgun import _is_mimetypes_broken
Expand Down
Loading