Skip to content

Commit a5fb38f

Browse files
authored
Merge pull request #157 from planetlabs/dangit-urlparse
use requests' urlparse for Py2 & Py3 compatibility
2 parents d0e432a + dccab7e commit a5fb38f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

planet/api/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import re
2323
import string
2424
import threading
25-
import urlparse
25+
from requests.compat import urlparse
2626
from ._fatomic import atomic_open
2727

2828
_ISO_FMT = '%Y-%m-%dT%H:%M:%S.%f+00:00'
@@ -202,7 +202,7 @@ def get_filename_from_url(url):
202202
:returns: a filename (i.e. ``basename``)
203203
:rtype: str or None
204204
"""
205-
path = urlparse.urlparse(url).path
205+
path = urlparse(url).path
206206
name = path[path.rfind('/')+1:]
207207
return name or None
208208

0 commit comments

Comments
 (0)