Skip to content

Commit

Permalink
Use py27compat module for compatibility. Removes undeclared dependenc…
Browse files Browse the repository at this point in the history
…y on six and fixes #266.
  • Loading branch information
jaraco committed Mar 19, 2017
1 parent a600d75 commit 36fdb8a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
@@ -1,3 +1,9 @@
10.3.1
------

* #266: Use private compatibity model rather than six to
avoid the dependency.

10.3
----

Expand Down
9 changes: 5 additions & 4 deletions keyring/backends/_OS_X_API.py
Expand Up @@ -3,7 +3,8 @@
import struct
from ctypes import c_void_p, c_uint16, c_uint32, c_int32, c_char_p, POINTER

import six
from keyring.py27compat import string_types, add_metaclass


sec_keychain_ref = sec_keychain_item_ref = c_void_p
OS_status = c_int32
Expand Down Expand Up @@ -145,20 +146,20 @@ def unpack(word):
>>> PackedAttributes.unpack('abcd')
1633837924
"""
if not isinstance(word, six.string_types):
if not isinstance(word, string_types):
return word
val, = struct.unpack('!I', word.encode('ascii'))
return val


@six.add_metaclass(PackedAttributes)
@add_metaclass(PackedAttributes)
class SecProtocolType(object):
kSecProtocolTypeHTTP = 'http'
kSecProtocolTypeHTTPS = 'htps'
kSecProtocolTypeFTP = 'ftp '


@six.add_metaclass(PackedAttributes)
@add_metaclass(PackedAttributes)
class SecAuthenticationType(object):
"""
>>> SecAuthenticationType.kSecAuthenticationTypeDefault
Expand Down

0 comments on commit 36fdb8a

Please sign in to comment.