Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pystache_custom
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pystache_custom
Commits
b2ae206d
Commit
b2ae206d
authored
Oct 31, 2011
by
Alex Gaynor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use `is` to compare integers.
parent
f543efac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
pystache/template.py
+1
-1
pystache/view.py
+2
-3
No files found.
pystache/template.py
View file @
b2ae206d
...
...
@@ -135,7 +135,7 @@ class Template(object):
raw
=
self
.
view
.
get
(
tag_name
,
''
)
# For methods with no return value
if
not
raw
and
raw
is
not
0
:
if
not
raw
and
raw
!=
0
:
if
tag_name
==
'.'
:
raw
=
self
.
view
.
context_list
[
0
]
else
:
...
...
pystache/view.py
View file @
b2ae206d
...
...
@@ -80,7 +80,7 @@ class View(object):
def
__getitem__
(
self
,
attr
):
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
)
return
val
...
...
@@ -91,4 +91,4 @@ class View(object):
raise
AttributeError
(
"Attribute '
%
s' does not exist in View"
%
attr
)
def
__str__
(
self
):
return
self
.
render
()
\ No newline at end of file
return
self
.
render
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment