diff options
author | Ilya Etingof <etingof@gmail.com> | 2017-08-02 19:46:47 +0200 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2017-08-02 19:46:47 +0200 |
commit | ed5150b82d4d0a99856ef4159ba7e5036b814c33 (patch) | |
tree | ca20ed77f61887526f18d12a2f5ca9f3ba4cde83 /pyasn1/type | |
parent | 991ed8a8c29fb967300af3d57e9fa13dcedf4900 (diff) | |
download | pyasn1-ed5150b82d4d0a99856ef4159ba7e5036b814c33.tar.gz |
fixed SequenceOf/SetOf initializers for backward compatibility
Diffstat (limited to 'pyasn1/type')
-rw-r--r-- | pyasn1/type/univ.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pyasn1/type/univ.py b/pyasn1/type/univ.py index 9371606..9991fea 100644 --- a/pyasn1/type/univ.py +++ b/pyasn1/type/univ.py @@ -1718,6 +1718,17 @@ class SequenceOfAndSetOfBase(base.AbstractConstructedAsn1Item): Object representing collection size constraint """ + def __init__(self, *args, **kwargs): + # support positional params for backward compatibility + if args: + for key, value in zip(('componentType', 'tagSet', + 'subtypeSpec', 'sizeSpec'), args): + if key in kwargs: + raise error.PyAsn1Error('Conflicting positional and keyword params!') + kwargs['componentType'] = value + + base.AbstractConstructedAsn1Item.__init__(self, **kwargs) + # Python list protocol def clear(self): |