Permalink
Browse files

Using None when imports were not available was making isinstance chec…

…ks crash
  • Loading branch information...
1 parent fc9b179 commit 70d878af0e65716dc5061c3392fd8655afe4987b @amol- amol- committed Nov 21, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 tg/jsonify.py
View
9 tg/jsonify.py
@@ -7,17 +7,20 @@
from webob.multidict import MultiDict
+class NotExistingImport:
+ pass
+
try:
import sqlalchemy
from sqlalchemy.engine.base import ResultProxy, RowProxy
except ImportError:
- ResultProxy=None
- RowProxy=None
+ ResultProxy=NotExistingImport
+ RowProxy=NotExistingImport
try:
from bson import ObjectId
except ImportError:
- ObjectId=None
+ ObjectId=NotExistingImport
def is_saobject(obj):
return hasattr(obj, '_sa_class_manager')

0 comments on commit 70d878a

Please sign in to comment.