diff options
author | Ilya Etingof <etingof@gmail.com> | 2017-07-26 18:40:01 +0200 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2017-07-26 18:40:01 +0200 |
commit | d8f2798e6a01a79243ef98b42a25595bacb96b2f (patch) | |
tree | 9cea66ca0e81569c791cc9817333e08d86c3bfd7 /pyasn1/type | |
parent | 175f51b9ceb2098e89dc6f2bc0bb41ce92b9b745 (diff) | |
download | pyasn1-d8f2798e6a01a79243ef98b42a25595bacb96b2f.tar.gz |
fix to make property.setter working on Py2.5-
Diffstat (limited to 'pyasn1/type')
-rw-r--r-- | pyasn1/type/base.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pyasn1/type/base.py b/pyasn1/type/base.py index 0f088c6..c894002 100644 --- a/pyasn1/type/base.py +++ b/pyasn1/type/base.py @@ -54,8 +54,7 @@ class Asn1ItemBase(Asn1Item): super(Asn1ItemBase, self).__setattr__(name, value) - @property - def readOnly(self): + def __getReadOnly(self): try: return self._readOnly @@ -64,8 +63,7 @@ class Asn1ItemBase(Asn1Item): return frozenset(self._readOnly) - @readOnly.setter - def readOnly(self, value): + def __setReadOnly(self, value): try: self._readOnly.add(value) @@ -74,6 +72,9 @@ class Asn1ItemBase(Asn1Item): self._readOnly.add(value) + # property.setter is only available past Python 2.5 + readOnly = property(__getReadOnly, __setReadOnly) + @property def effectiveTagSet(self): """For |ASN.1| type is equivalent to *tagSet* |