Skip to content

Commit f205a64

Browse files
weinshectomasbedrich
authored andcommitted
Add python 3.7 support, update CI targets
* Replace StopIteration with return statements + Changes conformal with PEP479 + Fixes #106 * Add Python versions 3.6 and 3.7 to Travis CI * Workaround for Python 3.7 in Travis CI
1 parent 0ee3bd2 commit f205a64

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

.travis.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
language: python
22
sudo: false
33

4-
python:
5-
- 3.4
6-
- 3.5
4+
matrix:
5+
include:
6+
- python: 3.4
7+
- python: 3.5
8+
- python: 3.6
9+
- python: 3.7
10+
dist: xenial
11+
sudo: true
12+
713

814
install:
915
- python3 setup.py build install

pycaching/cache.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -827,13 +827,13 @@ def load_logbook(self, limit=float("inf")):
827827

828828
if not logbook_page:
829829
# result is empty - no more logs
830-
raise StopIteration()
830+
return
831831

832832
for log_data in logbook_page:
833833

834834
limit -= 1 # handle limit
835835
if limit < 0:
836-
raise StopIteration()
836+
return
837837

838838
img_filename = log_data["LogTypeImage"].rsplit(".", 1)[0] # filename w/o extension
839839

@@ -860,7 +860,7 @@ def load_trackables(self, limit=float("inf")):
860860
url = self._trackable_page_url # will trigger lazy_loading if needed
861861
if not url:
862862
# no link to all trackables = no trackables in cache
863-
raise StopIteration()
863+
return
864864
res = self.geocaching._request(url)
865865

866866
trackable_table = res.find_all("table")[1]
@@ -874,7 +874,7 @@ def load_trackables(self, limit=float("inf")):
874874

875875
limit -= 1 # handle limit
876876
if limit < 0:
877-
raise StopIteration()
877+
return
878878

879879
# create and fill trackable object
880880
t = Trackable(self.geocaching, None)

pycaching/geocaching.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def search(self, point, limit=float("inf")):
217217

218218
if not geocaches_table:
219219
# result is empty - no more caches
220-
raise StopIteration()
220+
return
221221

222222
# prepare language-dependant mappings
223223
if start_index == 0:
@@ -233,7 +233,7 @@ def search(self, point, limit=float("inf")):
233233

234234
limit -= 1 # handle limit
235235
if limit < 0:
236-
raise StopIteration()
236+
return
237237

238238
# parse raw data
239239
cache_details = row.find("span", "cache-details").text.split("|")

0 commit comments

Comments
 (0)