Skip to content

Commit 18b38df

Browse files
committed
Bugfix: zip files were not imported anymore.
This bug was introduced in 2.0.6
1 parent df829a2 commit 18b38df

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cities_light/geonames.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ def __init__(self, url, force=False):
2323

2424
self.downloaded = self.download(url, self.file_path, force)
2525

26-
if self.downloaded and destination_file_name.split('.')[-1] == 'zip':
27-
# extract the destination file, use the extracted file as new
28-
# destination
29-
destination_file_name = destination_file_name.replace(
30-
'zip', 'txt')
26+
# extract the destination file, use the extracted file as new
27+
# destination
28+
destination_file_name = destination_file_name.replace(
29+
'zip', 'txt')
3130

31+
if self.downloaded and destination_file_name.split('.')[-1] == 'zip':
3232
self.extract(self.file_path, destination_file_name)
3333

34-
self.file_path = os.path.join(
35-
DATA_DIR, destination_file_name)
34+
self.file_path = os.path.join(
35+
DATA_DIR, destination_file_name)
3636

3737
def download(self, url, path, force=False):
3838
remote_file = urllib.urlopen(url)

0 commit comments

Comments
 (0)