diff options
author | elie <elie> | 2015-09-10 19:59:23 +0000 |
---|---|---|
committer | elie <elie> | 2015-09-10 19:59:23 +0000 |
commit | 6a26d80831a37e1d2f142cafc83763e234523ed1 (patch) | |
tree | 07061039fe5e304f9e9b6f8d07914e804db21355 /pyasn1/compat | |
parent | f8de0e370466ec8e4e81915e82fae4888f966586 (diff) | |
download | pyasn1-6a26d80831a37e1d2f142cafc83763e234523ed1.tar.gz |
fix to ObjectIdentifier initialization from unicode string
Diffstat (limited to 'pyasn1/compat')
-rw-r--r-- | pyasn1/compat/octets.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pyasn1/compat/octets.py b/pyasn1/compat/octets.py index f7f2a29..e812737 100644 --- a/pyasn1/compat/octets.py +++ b/pyasn1/compat/octets.py @@ -9,6 +9,7 @@ if version_info[0] <= 2: str2octs = lambda x: x octs2str = lambda x: x isOctetsType = lambda s: isinstance(s, str) + isStringType = lambda s: isinstance(s, (str, unicode)) else: ints2octs = bytes int2oct = lambda x: ints2octs((x,)) @@ -18,3 +19,4 @@ else: str2octs = lambda x: x.encode() octs2str = lambda x: x.decode() isOctetsType = lambda s: isinstance(s, bytes) + isStringType = lambda s: isinstance(s, str) |