From c49e826a6ab89d81ecebcca483277f3934809572 Mon Sep 17 00:00:00 2001 From: elie Date: Tue, 20 Jan 2015 17:09:28 +0000 Subject: provide all() that is missing in Python 2.4 --- pyasn1/type/univ.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pyasn1/type/univ.py b/pyasn1/type/univ.py index 87a5302..bc0a0f4 100644 --- a/pyasn1/type/univ.py +++ b/pyasn1/type/univ.py @@ -279,6 +279,15 @@ class BitString(base.AbstractSimpleAsn1Item): def prettyOut(self, value): return '\"\'%s\'B\"' % ''.join([str(x) for x in value]) +try: + all +except NameError: # Python 2.4 + def all(iterable): + for element in iterable: + if not element: + return False + return True + class OctetString(base.AbstractSimpleAsn1Item): tagSet = baseTagSet = tag.initTagSet( tag.Tag(tag.tagClassUniversal, tag.tagFormatSimple, 0x04) -- cgit v1.2.1