Skip to content

Commit

Permalink
Merge pull request #983 from cannatag/update-for-pyasn1-0-5
Browse files Browse the repository at this point in the history
Updated tagMap and typeMap imports for pyasn1 0.5.0+
  • Loading branch information
zorn96 authored Sep 3, 2021
2 parents 72febaa + ca689f4 commit 040e09f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ldap3/utils/asn1.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ class BooleanCEREncoder(BooleanEncoder):

tagMap[Boolean.tagSet] = BooleanCEREncoder()
else:
from pyasn1.codec.ber.encoder import tagMap, typeMap, AbstractItemEncoder
if pyasn1_version >= '0.5.0':
from pyasn1.codec.ber.encoder import AbstractItemEncoder
from pyasn1.codec.ber.encoder import TAG_MAP as tagMap
from pyasn1.codec.ber.encoder import TYPE_MAP as typeMap
else:
from pyasn1.codec.ber.encoder import tagMap, typeMap, AbstractItemEncoder
from pyasn1.type.univ import Boolean
from copy import deepcopy

Expand Down

0 comments on commit 040e09f

Please sign in to comment.