summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2012-06-29 14:06:40 +0200
committerFlorian Bruhin <me@the-compiler.org>2012-06-29 14:06:40 +0200
commit93889deede20f915117bf852f2c48ad966e1d375 (patch)
treedfbdb1df8819828f8cfce4f0c34ab25f5fdffd6d
parenta5e699f3ae3f1393a3a0c9e2bb0de237f3e6b8c6 (diff)
downloadxdd2esi-93889deede20f915117bf852f2c48ad966e1d375.tar.gz
xdd2esi-93889deede20f915117bf852f2c48ad966e1d375.zip
Return original value when convert_casting when cast was invalid
-rw-r--r--xddlib.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/xddlib.py b/xddlib.py
index 3269ef9..8c9b485 100644
--- a/xddlib.py
+++ b/xddlib.py
@@ -300,6 +300,7 @@ def _convert_cast_attribute(obj, label, units):
except (ValueError, KeyError):
warnings.warn("{}={} in {} is not a valid {}!".format(label, value,
obj, unit), CastConvertWarning)
+ newvalue = value
except TypeError: # None
warnings.warn("Can't convert {}={} to {}!".format(label, value, unit),
NoCastConvertFunctionWarning)