diff options
author | elie <elie> | 2012-12-04 07:34:25 +0000 |
---|---|---|
committer | elie <elie> | 2012-12-04 07:34:25 +0000 |
commit | f183b85e4bd2a6a79ee267a3af42a5e883d703a6 (patch) | |
tree | 866060a9ad681c4f394075107874bc62d04d1197 /pyasn1 | |
parent | d6546593f4c48afc7039228b9f3f2052a134c6d6 (diff) | |
download | pyasn1-f183b85e4bd2a6a79ee267a3af42a5e883d703a6.tar.gz |
make prettyPrint() working for non-initialized pyasn1 data objects
Diffstat (limited to 'pyasn1')
-rw-r--r-- | pyasn1/type/base.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pyasn1/type/base.py b/pyasn1/type/base.py index db31671..4087371 100644 --- a/pyasn1/type/base.py +++ b/pyasn1/type/base.py @@ -120,7 +120,12 @@ class AbstractSimpleAsn1Item(Asn1ItemBase): def prettyIn(self, value): return value def prettyOut(self, value): return str(value) - def prettyPrint(self, scope=0): return self.prettyOut(self._value) + def prettyPrint(self, scope=0): + if self._value is noValue: + return '<no value>' + else: + return self.prettyOut(self._value) + # XXX Compatibility stub def prettyPrinter(self, scope=0): return self.prettyPrint(scope) |