summaryrefslogtreecommitdiffstats
path: root/mirrors
diff options
context:
space:
mode:
authorJelle van der Waa <jelle@vdwaa.nl>2018-02-16 22:08:35 +0100
committerJelle van der Waa <jelle@vdwaa.nl>2019-01-21 21:19:58 +0100
commitc612b1931415ca5e6a7265b4e06cd045e851e07e (patch)
tree89527c2290c58721042a063d26b59cd135a1b12f /mirrors
parent7742430a261f36a834b93d2b8242cf847d25caa3 (diff)
downloadarchweb-c612b1931415ca5e6a7265b4e06cd045e851e07e.tar.gz
archweb-c612b1931415ca5e6a7265b4e06cd045e851e07e.zip
main: run 2to3
Diffstat (limited to 'mirrors')
-rw-r--r--mirrors/views/api.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mirrors/views/api.py b/mirrors/views/api.py
index 857b1d1d..268bf330 100644
--- a/mirrors/views/api.py
+++ b/mirrors/views/api.py
@@ -24,7 +24,7 @@ class MirrorStatusJSONEncoder(DjangoJSONEncoder):
if isinstance(obj, MirrorUrl):
data = {attr: getattr(obj, attr) for attr in self.url_attributes}
country = obj.country
- data['country'] = unicode(country.name)
+ data['country'] = str(country.name)
data['country_code'] = country.code
data['isos'] = obj.mirror.isos
data['ipv4'] = obj.has_ipv4
@@ -32,7 +32,7 @@ class MirrorStatusJSONEncoder(DjangoJSONEncoder):
data['details'] = obj.get_full_url()
return data
if isinstance(obj, MirrorProtocol):
- return unicode(obj)
+ return str(obj)
return super(MirrorStatusJSONEncoder, self).default(obj)
@@ -64,7 +64,7 @@ class LocationJSONEncoder(DjangoJSONEncoder):
'id': obj.pk,
'hostname': obj.hostname,
'source_ip': obj.source_ip,
- 'country': unicode(obj.country.name),
+ 'country': str(obj.country.name),
'country_code': obj.country.code,
'ip_version': obj.ip_version,
}