Skip to content
Snippets Groups Projects
Commit 90e70ae8ecbf authored by Jan Pipek's avatar Jan Pipek
Browse files

Trivial changes from the MR.

parent bc626caae054
No related branches found
No related tags found
No related merge requests found
......@@ -64,7 +64,7 @@
if isinstance(substrate, BytesIO):
cp = substrate.tell()
substrate.seek(0, os.SEEK_END)
result = not(substrate.tell() - cp)
result = substrate.tell() == cp
substrate.seek(cp, os.SEEK_SET)
return result
else:
......@@ -183,7 +183,7 @@
raise error.PyAsn1Error('Simple tag format expected')
the_bytes = substrate.read(length)
if len(the_bytes) == 0:
if not the_bytes:
return self._createComponent(asn1Spec, tagSet, 0, **options)
value = from_bytes(the_bytes, signed=True)
......@@ -212,7 +212,7 @@
return substrateFun(self._createComponent(
asn1Spec, tagSet, noValue, **options), substrate, length)
if endOfStream(substrate) or not length:
if not length or endOfStream(substrate):
raise error.PyAsn1Error('Empty BIT STRING substrate')
if tagSet[0].tagFormat == tag.tagFormatSimple: # XXX what tag to check?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment