summaryrefslogtreecommitdiff
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
parent154c55b30e335482a074ac76ad4e5abdc41ccc8b (diff)
downloadpyasn1-git-3082b398fd2074a9fe9d5ba49964cbf0353df081.tar.gz
minor PEP8 edits
-rw-r--r--pyasn1/codec/ber/decoder.py5
-rw-r--r--pyasn1/codec/ber/encoder.py8
-rw-r--r--pyasn1/compat/calling.py3
-rw-r--r--pyasn1/compat/integer.py1
-rw-r--r--pyasn1/compat/string.py2
5 files changed, 10 insertions, 9 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 = {
diff --git a/pyasn1/compat/calling.py b/pyasn1/compat/calling.py
index 0b2c464..fde25d8 100644
--- a/pyasn1/compat/calling.py
+++ b/pyasn1/compat/calling.py
@@ -12,7 +12,8 @@ __all__ = ['callable']
if (2, 7) < version_info[:2] < (3, 2):
import collections
- callable = lambda x: isinstance(x, collections.Callable)
+ def callable(x):
+ return isinstance(x, collections.Callable)
else:
diff --git a/pyasn1/compat/integer.py b/pyasn1/compat/integer.py
index 11992c3..0c426a2 100644
--- a/pyasn1/compat/integer.py
+++ b/pyasn1/compat/integer.py
@@ -106,4 +106,3 @@ else:
def bitLength(number):
return int(number).bit_length()
-
diff --git a/pyasn1/compat/string.py b/pyasn1/compat/string.py
index 058eb48..24e64b6 100644
--- a/pyasn1/compat/string.py
+++ b/pyasn1/compat/string.py
@@ -23,4 +23,4 @@ if version_info[:2] <= (2, 5):
else:
def partition(string, sep):
- return string.partition(sep) \ No newline at end of file
+ return string.partition(sep)