Skip to content

Commit 6f53263

Browse files
authored
Merge pull request #881 from krinsman/step7_2
remove python2 super syntax
2 parents 25601a3 + 39cd518 commit 6f53263

File tree

11 files changed

+16
-16
lines changed

11 files changed

+16
-16
lines changed

nbviewer/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class AsyncMultipartMemcache(AsyncMemcache):
155155
def __init__(self, *args, **kwargs):
156156
self.chunk_size = kwargs.pop('chunk_size', 950000)
157157
self.max_chunks = kwargs.pop('max_chunks', 16)
158-
super(AsyncMultipartMemcache, self).__init__(*args, **kwargs)
158+
super().__init__(*args, **kwargs)
159159

160160
async def get(self, key, *args, **kwargs):
161161
keys = [('%s.%i' % (key, idx)).encode()

nbviewer/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
class Custom404(BaseHandler):
2626
"""Render our 404 template"""
2727
def prepare(self):
28-
super(BaseHandler, self).prepare()
28+
super().prepare()
2929
raise web.HTTPError(404)
3030

3131

nbviewer/providers/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def redirect(self, url, *args, **kwargs):
8383
purl.fragment
8484
))
8585

86-
return super(BaseHandler, self).redirect(
86+
return super().redirect(
8787
eurl,
8888
*args,
8989
**kwargs
@@ -585,7 +585,7 @@ def render_timeout(self):
585585
return self.settings.setdefault('render_timeout', 0)
586586

587587
def initialize(self, **kwargs):
588-
super(RenderingHandler, self).initialize(**kwargs)
588+
super().initialize(**kwargs)
589589
loop = IOLoop.current()
590590
if self.render_timeout:
591591
self.slow_timeout = loop.add_timeout(

nbviewer/providers/gist/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def client_error_message(self, exc, url, body, msg=None):
5252
if exc.code == 403 and 'too big' in body.lower():
5353
return 400, "GitHub will not serve raw gists larger than 10MB"
5454

55-
return super(GistClientMixin, self).client_error_message(
55+
return super().client_error_message(
5656
exc, url, body, msg
5757
)
5858

nbviewer/providers/github/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def client_error_message(self, exc, url, body, msg=None):
8383
if exc.code == 403 and 'rate limit' in body.lower():
8484
return 503, "GitHub API rate limit exceeded. Try again soon."
8585

86-
return super(GithubClientMixin, self).client_error_message(
86+
return super().client_error_message(
8787
exc, url, body, msg
8888
)
8989

nbviewer/providers/github/tests/test_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import unittest.mock as mock
44

55
from tornado.httpclient import AsyncHTTPClient
6-
from tornado.testing import AsyncTestCase, gen_test
6+
from tornado.testing import AsyncTestCase
77

88
from ..client import AsyncGitHubClient
99
from ....utils import quote
@@ -12,7 +12,7 @@
1212
class GithubClientTest(AsyncTestCase):
1313
"""Tests that the github API client makes the correct http requests."""
1414
def setUp(self):
15-
super(GithubClientTest, self).setUp()
15+
super().setUp()
1616
# Need a mock HTTPClient for the github client to talk to.
1717
self.http_client = mock.create_autospec(AsyncHTTPClient)
1818

nbviewer/providers/local/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def breadcrumbs(self, path):
6161
'url': url_path_join(self.base_url, self._localfile_path),
6262
'name': 'home'
6363
}]
64-
breadcrumbs.extend(super(LocalFileHandler, self).breadcrumbs(path, self._localfile_path))
64+
breadcrumbs.extend(super().breadcrumbs(path, self._localfile_path))
6565
return breadcrumbs
6666

6767
async def download(self, fullpath):

nbviewer/tests/async_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_app(self):
1616
def assertIn(self, observed, expected, *args, **kwargs):
1717
""" test whether the observed contains the expected, in utf-8
1818
"""
19-
return super(AsyncNbviewerTestCase, self).assertIn(
19+
return super().assertIn(
2020
to_unicode(observed),
2121
to_unicode(expected),
2222
*args,
@@ -26,7 +26,7 @@ def assertIn(self, observed, expected, *args, **kwargs):
2626
def assertNotIn(self, observed, expected, *args, **kwargs):
2727
""" test whether the observed does not contain the expected, in utf-8
2828
"""
29-
return super(AsyncNbviewerTestCase, self).assertNotIn(
29+
return super().assertNotIn(
3030
to_unicode(observed),
3131
to_unicode(expected),
3232
*args,

nbviewer/tests/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ class NBViewerTestCase(TestCase):
3131
port = 12341
3232

3333
def assertIn(self, observed, expected, *args, **kwargs):
34-
return super(NBViewerTestCase, self).assertIn(
34+
return super().assertIn(
3535
to_unicode(observed),
3636
to_unicode(expected),
3737
*args,
3838
**kwargs
3939
)
4040

4141
def assertNotIn(self, observed, expected, *args, **kwargs):
42-
return super(NBViewerTestCase, self).assertNotIn(
42+
return super().assertNotIn(
4343
to_unicode(observed),
4444
to_unicode(expected),
4545
*args,

nbviewer/tests/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_used_custom_template(self):
2020
class TemplatePathCLITestCase(NBViewerTestCase, CustomTemplateStub):
2121
@classmethod
2222
def get_server_args(cls):
23-
return super(TemplatePathCLITestCase, cls).get_server_args() + [
23+
return super().get_server_args() + [
2424
'--template_path={}'.format(tmpl_fixture),
2525
]
2626

0 commit comments

Comments
 (0)