BIND 10 trac929, updated. e54237acf184e5dc6d03409869b525152a259f2a [trac929] replace != None with is not None
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Jul 27 16:33:59 UTC 2011
The branch, trac929 has been updated
via e54237acf184e5dc6d03409869b525152a259f2a (commit)
from 211f6c58e8cd6311eaca0a2ba181c4bfb379476c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e54237acf184e5dc6d03409869b525152a259f2a
Author: Jelte Jansen <jelte at isc.org>
Date: Wed Jul 27 18:32:06 2011 +0200
[trac929] replace != None with is not None
-----------------------------------------------------------------------
Summary of changes:
src/lib/python/isc/config/module_spec.py | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/python/isc/config/module_spec.py b/src/lib/python/isc/config/module_spec.py
index 1d51f98..f9ec8b7 100644
--- a/src/lib/python/isc/config/module_spec.py
+++ b/src/lib/python/isc/config/module_spec.py
@@ -92,7 +92,7 @@ class ModuleSpec:
return _validate_spec_list(data_def, full, data, errors)
else:
# no spec, always bad
- if errors != None:
+ if errors is not None:
errors.append("No config_data specification")
return False
@@ -130,11 +130,11 @@ class ModuleSpec:
non-default values). Also it checks 'item_format' in case
of time"""
stat_spec = self.get_statistics_spec()
- if stat_spec != None:
+ if stat_spec is not None:
return _validate_spec_list(stat_spec, full, stat, errors)
else:
# no spec, always bad
- if errors != None:
+ if errors is not None:
errors.append("No statistics specification")
return False
@@ -341,27 +341,27 @@ def _validate_type(spec, value, errors):
specification"""
data_type = spec['item_type']
if data_type == "integer" and type(value) != int:
- if errors != None:
+ if errors is not None:
errors.append(str(value) + " should be an integer")
return False
elif data_type == "real" and type(value) != float:
- if errors != None:
+ if errors is not None:
errors.append(str(value) + " should be a real")
return False
elif data_type == "boolean" and type(value) != bool:
- if errors != None:
+ if errors is not None:
errors.append(str(value) + " should be a boolean")
return False
elif data_type == "string" and type(value) != str:
- if errors != None:
+ if errors is not None:
errors.append(str(value) + " should be a string")
return False
elif data_type == "list" and type(value) != list:
- if errors != None:
+ if errors is not None:
errors.append(str(value) + " should be a list")
return False
elif data_type == "map" and type(value) != dict:
- if errors != None:
+ if errors is not None:
errors.append(str(value) + " should be a map")
return False
else:
@@ -373,7 +373,7 @@ def _validate_format(spec, value, errors):
if "item_format" in spec:
item_format = spec['item_format']
if not _check_format(value, item_format):
- if errors != None:
+ if errors is not None:
errors.append("format type of " + str(value)
+ " should be " + item_format)
return False
@@ -408,7 +408,7 @@ def _validate_spec(spec, full, data, errors):
elif item_name in data:
return _validate_item(spec, full, data[item_name], errors)
elif full and not item_optional:
- if errors != None:
+ if errors is not None:
errors.append("non-optional item " + item_name + " missing")
return False
else:
@@ -433,7 +433,7 @@ def _validate_spec_list(module_spec, full, data, errors):
if spec_item["item_name"] == item_name:
found = True
if not found and item_name != "version":
- if errors != None:
+ if errors is not None:
errors.append("unknown item " + item_name)
validated = False
return validated
More information about the bind10-changes
mailing list