Skip to content

Commit

Permalink
Import urllib.quote() on Python 2.
Browse files Browse the repository at this point in the history
On Python 3 import urllib.parse.quote().
  • Loading branch information
jfinkels committed Mar 5, 2015
1 parent 97a6827 commit 872bfe9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_views.py
Expand Up @@ -15,7 +15,12 @@
from datetime import datetime
from datetime import timedelta
import math
from urllib.parse import quote as urlquote
# In Python 2, the function is `urllib.quote()`, in Python 3 it is
# `urllib.parse.quote()`.
try:
from urllib.parse import quote as urlquote
except:
from urllib import quote as urlquote

import dateutil
from flask import json
Expand Down

0 comments on commit 872bfe9

Please sign in to comment.