diff options
author | elie <elie> | 2015-01-20 17:09:28 +0000 |
---|---|---|
committer | elie <elie> | 2015-01-20 17:09:28 +0000 |
commit | c49e826a6ab89d81ecebcca483277f3934809572 (patch) | |
tree | 2a1c62ffd66e3e6563f9f6095dae4d26154ed1ab | |
parent | dbed6d9790223208d145ce3a14bb8f8d29cfc987 (diff) | |
download | pyasn1-c49e826a6ab89d81ecebcca483277f3934809572.tar.gz |
provide all() that is missing in Python 2.4
-rw-r--r-- | pyasn1/type/univ.py | 9 |
1 files changed, 9 insertions, 0 deletions
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) |