Skip to content

Commit

Permalink
Use single quotes in code
Browse files Browse the repository at this point in the history
  • Loading branch information
yaph committed Nov 2, 2021
1 parent b8b85c3 commit 64b7ee3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion geonamescache/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def search_cities(self, query, attribute='alternatenames', case_sensitive=True):
if query in record[attribute]:
results.append(record)
else:
lower_func = "casefold" if hasattr("", "casefold") else "lower"
lower_func = 'casefold' if hasattr('', 'casefold') else 'lower'
if isinstance(record[attribute], list):
if any(
getattr(query, lower_func)() == getattr(value, lower_func)()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_geonamescache.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def test_search_cities_case_sensitive_with_casefold(self):
cities = self.geonamescache.search_cities('Giessen', attribute='name')
self.assertGreaterEqual(len(cities), 0)
cities = self.geonamescache.search_cities('Giessen', attribute='name', case_sensitive=False)
self.assertGreaterEqual(len(cities), 1 if hasattr("", "casefold") else 0)
self.assertGreaterEqual(len(cities), 1 if hasattr('', 'casefold') else 0)

def test_us_counties_len(self):
# Make sure there are 3235 counties, which includes Puerto Rico etc.
Expand Down

0 comments on commit 64b7ee3

Please sign in to comment.