Commit b2ae206d by Alex Gaynor

Don't use `is` to compare integers.

parent f543efac
...@@ -135,7 +135,7 @@ class Template(object): ...@@ -135,7 +135,7 @@ class Template(object):
raw = self.view.get(tag_name, '') raw = self.view.get(tag_name, '')
# For methods with no return value # For methods with no return value
if not raw and raw is not 0: if not raw and raw != 0:
if tag_name == '.': if tag_name == '.':
raw = self.view.context_list[0] raw = self.view.context_list[0]
else: else:
......
...@@ -80,7 +80,7 @@ class View(object): ...@@ -80,7 +80,7 @@ class View(object):
def __getitem__(self, attr): def __getitem__(self, attr):
val = self.get(attr, None) val = self.get(attr, None)
if not val and val is not 0: if not val and val != 0:
raise KeyError("Key '%s' does not exist in View" % attr) raise KeyError("Key '%s' does not exist in View" % attr)
return val return val
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment