Permalink
Browse files

Merge pull request #52 from elephantjim/urlencode-2to3

2to3 compatibility: urlencode is in urllib in python2 and urllib.parse in python3
  • Loading branch information...
2 parents c748830 + 6ae0257 commit d6a293f0d54b4ca2dca1c335f9867cd2310f6fc7 @nikhilm nikhilm committed Jul 29, 2016
Showing with 6 additions and 2 deletions.
  1. +6 −2 iron_mq.py
View
@@ -1,5 +1,9 @@
import iron_core
-import urllib
+
+try:
+ from urllib.parse import urlencode
+except ImportError:
+ from urllib import urlencode
try:
import json
@@ -328,7 +332,7 @@ def queues(self, page=None, per_page=None, previous=None, prefix=None):
if prefix is not None:
options['prefix'] = prefix
- query = urllib.urlencode(options)
+ query = urlencode(options)
url = 'queues'
if query != '':
url = "%s?%s" % (url, query)

0 comments on commit d6a293f

Please sign in to comment.