summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2012-06-29 13:37:44 +0200
committerFlorian Bruhin <me@the-compiler.org>2012-06-29 13:37:44 +0200
commita5e699f3ae3f1393a3a0c9e2bb0de237f3e6b8c6 (patch)
tree50ff26913801d8a76ecabf5926f03e5afb77ea02
parented702138f64fb990832bed75032030aaba58b1b0 (diff)
downloadxdd2esi-a5e699f3ae3f1393a3a0c9e2bb0de237f3e6b8c6.tar.gz
xdd2esi-a5e699f3ae3f1393a3a0c9e2bb0de237f3e6b8c6.zip
Handle strings without default string correctly in xdd2esilib
-rw-r--r--xdd2esilib.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/xdd2esilib.py b/xdd2esilib.py
index 88a2438..b820bd1 100644
--- a/xdd2esilib.py
+++ b/xdd2esilib.py
@@ -94,8 +94,10 @@ def _get_infocomment(obj, attr):
def _get_default(obj, attr):
""" Gets the default value of the object """
- if _is_string(obj):
+ if _is_string(obj) and obj.default is not None:
esi_default = _hexlify(obj)
+ elif _is_string(obj):
+ esi_default = None
elif isinstance(obj.default, str):
esi_default = obj.default.replace("0x", "#x")
else: