autoxml: Check values against NoneType

The expression "value" is also False when the value equals zero. This
prevents the presence of the tags with a value of zero.

BUG:FIXED:18467
This commit is contained in:
Fatih Aşıcı
2011-06-22 07:00:12 +00:00
parent 6f92074a97
commit 65330b8c3e
+2 -2
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 - 2007, TUBITAK/UEKAE
# Copyright (C) 2005-2011, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
@@ -662,7 +662,7 @@ class autoxml(oo.autosuper, oo.autoprop):
def encode(node, value, errs):
"""encode given value inside DOM node"""
if value:
if value is not None:
writetext(node, token, unicode(value))
else:
if req == mandatory: