diff options
author | wbond <will@wbond.net> | 2017-11-28 11:12:32 -0500 |
---|---|---|
committer | wbond <will@wbond.net> | 2017-11-28 11:12:32 -0500 |
commit | b7256ed36f786a79ce93c72a5c6bcbe2826c8832 (patch) | |
tree | 2857b87569bb837f4ef42dad2d5e5340bb4d22d3 /asn1crypto/pem.py | |
parent | 7f587d56f2b5c4815bfed835cfc10abd9c49cdb2 (diff) | |
download | asn1crypto-b7256ed36f786a79ce93c72a5c6bcbe2826c8832.tar.gz |
Fix type checking in pem.armor()
Diffstat (limited to 'asn1crypto/pem.py')
-rw-r--r-- | asn1crypto/pem.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/asn1crypto/pem.py b/asn1crypto/pem.py index 8cb6024..245dc13 100644 --- a/asn1crypto/pem.py +++ b/asn1crypto/pem.py @@ -16,7 +16,7 @@ import re import sys from ._errors import unwrap -from ._types import type_name, str_cls, byte_cls +from ._types import type_name as _type_name, str_cls, byte_cls if sys.version_info < (3,): from cStringIO import StringIO as BytesIO @@ -41,7 +41,7 @@ def detect(byte_string): ''' byte_string must be a byte string, not %s ''', - type_name(byte_string) + _type_name(byte_string) )) return byte_string.find(b'-----BEGIN') != -1 or byte_string.find(b'---- BEGIN') != -1 @@ -71,7 +71,7 @@ def armor(type_name, der_bytes, headers=None): raise TypeError(unwrap( ''' der_bytes must be a byte string, not %s - ''' % type_name(der_bytes) + ''' % _type_name(der_bytes) )) if not isinstance(type_name, str_cls): @@ -79,7 +79,7 @@ def armor(type_name, der_bytes, headers=None): ''' type_name must be a unicode string, not %s ''', - type_name(type_name) + _type_name(type_name) )) type_name = type_name.upper().encode('ascii') |