Permalink
Browse files

Merge pull request #106 from holgi/patch-1

Python 3 import error in mongodb.rst example
  • Loading branch information...
2 parents 5f27329 + b984f99 commit 1ad887982b4b66dc806a3319476acf58b0225c89 @tseaver tseaver committed Mar 4, 2014
Showing with 7 additions and 1 deletion.
  1. +7 −1 database/mongodb.rst
@@ -22,8 +22,14 @@ attached to each new request::
from pyramid.config import Configurator
+ try:
+ # for python 2
+ from urlparse import urlparse
+ except ImportError:
+ # for python 3
+ from urllib.parse import urlparse
+
from gridfs import GridFS
- from urlparse import urlparse
import pymongo

0 comments on commit 1ad8879

Please sign in to comment.