mirror of
https://github.com/wassname/geopandas.git
synced 2026-09-12 12:20:25 +08:00
PY3: Use six library to import urlopen for 2/3 compatibility
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
||||
import os.path
|
||||
import urllib2
|
||||
from six.moves.urllib.request import urlopen
|
||||
|
||||
from geopandas import GeoDataFrame, GeoSeries
|
||||
|
||||
@@ -29,7 +29,7 @@ def download_nybb():
|
||||
filename = os.path.join('examples', 'nybb_13a.zip')
|
||||
if not os.path.exists(filename):
|
||||
with open(filename, 'w') as f:
|
||||
response = urllib2.urlopen('http://www.nyc.gov/html/dcp/download/bytes/nybb_13a.zip')
|
||||
response = urlopen('http://www.nyc.gov/html/dcp/download/bytes/nybb_13a.zip')
|
||||
f.write(response.read())
|
||||
return filename
|
||||
|
||||
|
||||
Reference in New Issue
Block a user