Permalink
Browse files

Python 3 import error in mongodb.rst example

The urlparse module has been reorganized in Python 3 and therefore leads to an import error in the example "__init__.py" file.
  • Loading branch information...
1 parent ac34a62 commit b984f991207e59daac6d5be4ea667d0097db26a5 @holgi holgi committed Feb 28, 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 b984f99

Please sign in to comment.