Browse Source

Fix setting of query based on availability of PyQuery.

If PyQuery isn't available, it just doesn't set self.q
and later, when it is accessed in __call__, it throws
an exception. The solution is to set it to None if PyQuery
isn't available.
main
Muhammad Tauqir Ahmad 11 years ago
committed by Muhammad Tauqir Ahmad
parent
commit
a9635fac7d
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      hyde/template.py

+ 2
- 3
hyde/template.py View File

@@ -24,9 +24,8 @@ class HtmlWrap(object):
try:
from pyquery import PyQuery
except:
PyQuery = False
if PyQuery:
self.q = PyQuery(html)
PyQuery = None
self.q = PyQuery(html) if PyQuery else None

def __unicode__(self):
return self.raw


Loading…
Cancel
Save