File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change 29
29
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
30
"""
31
31
32
+ import base64
32
33
import copy
33
34
import datetime
34
35
import json
59
60
from .lib .httplib2 import Http , ProxyInfo , socks , ssl_error_classes
60
61
from .lib .sgtimezone import SgTimezone
61
62
62
- if six .PY3 :
63
- from base64 import encodebytes as base64encode
64
- else :
65
- from base64 import encodestring as base64encode
66
-
67
63
68
64
LOG = logging .getLogger ("shotgun_api3" )
69
65
"""
@@ -709,11 +705,11 @@ def __init__(
709
705
# and auth header
710
706
711
707
# Do NOT self._split_url(self.base_url) here, as it contains the lower
712
- # case version of the base_url argument. Doing so would base64encode
708
+ # case version of the base_url argument. Doing so would base64.encodebytes
713
709
# the lowercase version of the credentials.
714
710
auth , self .config .server = self ._split_url (base_url )
715
711
if auth :
716
- auth = base64encode (
712
+ auth = base64 . encodebytes (
717
713
urllib .parse .unquote (auth ).encode ("utf-8" )
718
714
).decode ("utf-8" )
719
715
self .config .authorization = "Basic " + auth .strip ()
Original file line number Diff line number Diff line change 12
12
CRUD functions. These tests always use a mock http connection so not not
13
13
need a live server to run against."""
14
14
15
+ import base64
15
16
import datetime
16
17
import json
17
18
import os
32
33
from shotgun_api3 .shotgun import ServerCapabilities , SG_TIMEZONE
33
34
from . import base
34
35
35
- if six .PY3 :
36
- from base64 import encodebytes as base64encode
37
- else :
38
- from base64 import encodestring as base64encode
39
-
40
36
41
37
def b64encode (val ):
42
38
if isinstance (val , str ):
43
39
val = val .encode ("utf-8" )
44
40
45
- return base64encode (val ).decode ("utf-8" )
41
+ return base64 . encodebytes (val ).decode ("utf-8" )
46
42
47
43
48
44
class TestShotgunClient (base .MockTestBase ):
You can’t perform that action at this time.
0 commit comments