aboutsummaryrefslogtreecommitdiff
path: root/pyasn1/codec
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2017-09-14 22:57:13 +0200
committerIlya Etingof <etingof@gmail.com>2017-09-14 22:57:13 +0200
commit3082b398fd2074a9fe9d5ba49964cbf0353df081 (patch)
tree137672686259adece2c7d04c2ae4281af8be9f4b /pyasn1/codec
parent154c55b30e335482a074ac76ad4e5abdc41ccc8b (diff)
downloadpyasn1-3082b398fd2074a9fe9d5ba49964cbf0353df081.tar.gz
minor PEP8 edits
Diffstat (limited to 'pyasn1/codec')
-rw-r--r--pyasn1/codec/ber/decoder.py5
-rw-r--r--pyasn1/codec/ber/encoder.py8
2 files changed, 7 insertions, 6 deletions
diff --git a/pyasn1/codec/ber/decoder.py b/pyasn1/codec/ber/decoder.py
index 5424195..3c3be9c 100644
--- a/pyasn1/codec/ber/decoder.py
+++ b/pyasn1/codec/ber/decoder.py
@@ -635,6 +635,7 @@ class UniversalConstructedTypeDecoder(AbstractConstructedDecoder):
return asn1Object, substrate
+
class SequenceOrSequenceOfDecoder(UniversalConstructedTypeDecoder):
protoRecordComponent = univ.Sequence()
protoSequenceComponent = univ.SequenceOf()
@@ -737,7 +738,7 @@ class AnyDecoder(AbstractSimpleDecoder):
decodeFun=None, substrateFun=None,
**options):
if asn1Spec is None or asn1Spec is not None and tagSet != asn1Spec.tagSet:
- fullSubstrate=options['fullSubstrate']
+ fullSubstrate = options['fullSubstrate']
# untagged Any container, recover inner header substrate
length += len(fullSubstrate) - len(substrate)
@@ -759,7 +760,7 @@ class AnyDecoder(AbstractSimpleDecoder):
# tagged Any type -- consume header substrate
header = null
else:
- fullSubstrate=options['fullSubstrate']
+ fullSubstrate = options['fullSubstrate']
# untagged Any, recover header substrate
header = fullSubstrate[:-len(substrate)]
diff --git a/pyasn1/codec/ber/encoder.py b/pyasn1/codec/ber/encoder.py
index b43e209..e52bb49 100644
--- a/pyasn1/codec/ber/encoder.py
+++ b/pyasn1/codec/ber/encoder.py
@@ -23,9 +23,9 @@ class AbstractItemEncoder(object):
if isConstructed:
encodedTag |= tag.tagFormatConstructed
if tagId < 31:
- return (encodedTag | tagId,)
+ return encodedTag | tagId,
else:
- substrate = (tagId & 0x7f,)
+ substrate = tagId & 0x7f,
tagId >>= 7
while tagId:
substrate = (0x80 | (tagId & 0x7f),) + substrate
@@ -36,7 +36,7 @@ class AbstractItemEncoder(object):
if not defMode and self.supportIndefLenMode:
return (0x80,)
if length < 0x80:
- return (length,)
+ return length,
else:
substrate = ()
while length:
@@ -388,7 +388,7 @@ class ChoiceEncoder(AbstractItemEncoder):
class AnyEncoder(OctetStringEncoder):
def encodeValue(self, value, encodeFun, **options):
- return value.asOctets(), options.get('defMode', True) == False, True
+ return value.asOctets(), not options.get('defMode', True), True
tagMap = {