summaryrefslogtreecommitdiff
path: root/pyasn1
diff options
context:
space:
mode:
authorelie <elie>2012-12-04 07:34:25 +0000
committerelie <elie>2012-12-04 07:34:25 +0000
commitf183b85e4bd2a6a79ee267a3af42a5e883d703a6 (patch)
tree866060a9ad681c4f394075107874bc62d04d1197 /pyasn1
parentd6546593f4c48afc7039228b9f3f2052a134c6d6 (diff)
downloadpyasn1-f183b85e4bd2a6a79ee267a3af42a5e883d703a6.tar.gz
make prettyPrint() working for non-initialized pyasn1 data objects
Diffstat (limited to 'pyasn1')
-rw-r--r--pyasn1/type/base.py7
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)