diff options
author | Ilya Etingof <etingof@gmail.com> | 2017-08-02 02:09:32 +0200 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2017-08-02 02:09:32 +0200 |
commit | a00fc22a6d510e673a936f8488c0683d3671f6aa (patch) | |
tree | 5498da5343af3878d2f6172896790be0aaee674f /pyasn1/type | |
parent | 29a49a725213adf19ed6ed83496946e219387748 (diff) | |
download | pyasn1-a00fc22a6d510e673a936f8488c0683d3671f6aa.tar.gz |
more fixes to threading racing
Diffstat (limited to 'pyasn1/type')
-rw-r--r-- | pyasn1/type/base.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/pyasn1/type/base.py b/pyasn1/type/base.py index 99e865f..b901123 100644 --- a/pyasn1/type/base.py +++ b/pyasn1/type/base.py @@ -85,12 +85,7 @@ class Asn1ItemBase(Asn1Item): def tagMap(self): """Return a :class:`~pyasn1.type.tagmap.TagMap` object mapping ASN.1 tags to ASN.1 objects within callee object. """ - try: - return self._tagMap - - except AttributeError: - self._tagMap = tagmap.TagMap({self.tagSet: self}) - return self._tagMap + return tagmap.TagMap({self.tagSet: self}) def isSameTypeWith(self, other, matchTags=True, matchConstraints=True): """Examine |ASN.1| type for equality with other ASN.1 type. @@ -235,7 +230,6 @@ class AbstractSimpleAsn1Item(Asn1ItemBase): exType, exValue, exTb = sys.exc_info() raise exType('%s at %s' % (exValue, self.__class__.__name__)) - self.__hashedValue = None self._value = value self._len = None @@ -278,9 +272,7 @@ class AbstractSimpleAsn1Item(Asn1ItemBase): return self._value and True or False def __hash__(self): - if self.__hashedValue is None: - self.__hashedValue = hash(self._value) - return self.__hashedValue + return hash(self._value) @property def isValue(self): |