Commit 59e1bc09 by Jiri Techet

Remove unnecessary parentheses

Detected by PyCharm inspections
parent f4ba4b61
......@@ -165,7 +165,7 @@ class GeoIP(object):
self._databaseType = ord(byte)
# Compatibility with databases from April 2003 and earlier
if (self._databaseType >= 106):
if self._databaseType >= 106:
self._databaseType -= 105
if self._databaseType == const.REGION_EDITION_REV0:
......@@ -361,15 +361,16 @@ class GeoIP(object):
record['continent'] = const.CONTINENT_NAMES[char]
buf_pos += 1
def get_data(buf, buf_pos):
offset = buf_pos
char = ord(buf[offset])
while (char != 0):
while char != 0:
offset += 1
char = ord(buf[offset])
if offset > buf_pos:
return (offset, buf[buf_pos:offset])
return (offset, '')
return offset, buf[buf_pos:offset]
return offset, ''
offset, record['region_name'] = get_data(buf, buf_pos)
offset, record['city'] = get_data(buf, offset + 1)
......
......@@ -740,7 +740,7 @@ _country = {
'ZA': 'Africa/Johannesburg',
'ZM': 'Africa/Lusaka',
'ZW': 'Africa/Harare'
}
}
def time_zone_by_country_and_region(country_code, region_name=None):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment