File: remove-six.patch

package info (click to toggle)
pymacaroons 0.13.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 288 kB
  • sloc: python: 1,262; makefile: 147
file content (92 lines) | stat: -rw-r--r-- 3,093 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Forwarded: https://github.com/ecordell/pymacaroons/pull/68

--- a/pymacaroons/caveat_delegates/encrypted_first_party.py
+++ b/pymacaroons/caveat_delegates/encrypted_first_party.py
@@ -1,7 +1,6 @@
 from __future__ import unicode_literals
 import binascii
 
-from six import iteritems
 from pymacaroons.field_encryptors import SecretBoxEncryptor
 
 from .first_party import (
@@ -46,7 +45,7 @@
     def verify_first_party_caveat(self, verifier, caveat, signature):
         predicate = caveat.caveat_id_bytes
 
-        for signifier, encryptor in iteritems(self.field_encryptors):
+        for signifier, encryptor in self.field_encryptors.items():
             if predicate.startswith(signifier):
                 predicate = encryptor.decrypt(
                     signature,
--- a/pymacaroons/serializers/binary_serializer.py
+++ b/pymacaroons/serializers/binary_serializer.py
@@ -2,7 +2,6 @@
 
 import binascii
 from collections import namedtuple
-import six
 import struct
 import sys
 from base64 import urlsafe_b64encode
@@ -93,7 +92,7 @@
         from pymacaroons.macaroon import MACAROON_V2
         from pymacaroons.exceptions import MacaroonDeserializationException
 
-        first = six.byte2int(serialized[:1])
+        first = serialized[0]
         if first == MACAROON_V2:
             return self._deserialize_v2(serialized)
         if _is_ascii_hex(first):
--- a/pymacaroons/utils.py
+++ b/pymacaroons/utils.py
@@ -3,15 +3,14 @@
 import hmac
 import binascii
 
-from six import text_type, binary_type
 
 
 def convert_to_bytes(string_or_bytes):
     if string_or_bytes is None:
         return None
-    if isinstance(string_or_bytes, text_type):
+    if isinstance(string_or_bytes, str):
         return string_or_bytes.encode('utf-8')
-    elif isinstance(string_or_bytes, binary_type):
+    elif isinstance(string_or_bytes, bytes):
         return string_or_bytes
     else:
         raise TypeError("Must be a string or bytes object.")
@@ -20,9 +19,9 @@
 def convert_to_string(string_or_bytes):
     if string_or_bytes is None:
         return None
-    if isinstance(string_or_bytes, text_type):
+    if isinstance(string_or_bytes, str):
         return string_or_bytes
-    elif isinstance(string_or_bytes, binary_type):
+    elif isinstance(string_or_bytes, bytes):
         return string_or_bytes.decode('utf-8')
     else:
         raise TypeError("Must be a string or bytes object.")
--- a/setup.py
+++ b/setup.py
@@ -25,7 +25,6 @@
     include_package_data=True,
     long_description=long_description,
     install_requires=[
-        'six>=1.8.0',
         'PyNaCl>=1.1.2,<2.0',
     ],
     classifiers=[
@@ -35,9 +34,6 @@
         'License :: OSI Approved :: MIT License',
         'Operating System :: OS Independent',
         'Programming Language :: Python',
-        'Programming Language :: Python :: 2',
-        'Programming Language :: Python :: 2.6',
-        'Programming Language :: Python :: 2.7',
         'Programming Language :: Python :: 3',
         'Programming Language :: Python :: 3.3',
         'Programming Language :: Python :: 3.4',