Skip to content

Commit 7b262cc

Browse files
committed
Run pyflakes and fix a couple errors.
1 parent 6138eea commit 7b262cc

File tree

15 files changed

+18
-17
lines changed

15 files changed

+18
-17
lines changed

nbviewer/providers/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def _load_provider_feature(feature, providers, **handler_names):
8383
try:
8484
# Ex: handler_names['url_handler']
8585
handler_names[provider_handler_key]
86-
except KeyError as e:
86+
except KeyError:
8787
continue
8888
else:
8989
# Ex: provider_handlers['url_handler'] = handler_names['url_handler']

nbviewer/providers/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ def write_error(self, status_code: int, **kwargs):
445445
# render the template
446446
try:
447447
html = self.render_status_code_template(status_code, **namespace)
448-
except Exception as e:
448+
except Exception:
449449
html = self.render_error_template(**namespace)
450450
self.set_header("Content-Type", "text/html")
451451
self.write(html)
@@ -561,7 +561,7 @@ async def cached_method(self, *args, **kwargs):
561561
cached = pickle.loads(cached_pickle)
562562
else:
563563
cached = None
564-
except Exception as e:
564+
except Exception:
565565
self.log.error("Exception getting %s from cache", short_url, exc_info=True)
566566
cached = None
567567

@@ -631,7 +631,7 @@ def filter_formats(self, nb, raw):
631631
try:
632632
if test is None or test(nb, raw):
633633
yield (name, format)
634-
except Exception as err:
634+
except Exception:
635635
self.log.info("Failed to test %s: %s", self.request.uri, name)
636636

637637
# empty methods to be implemented by subclasses to make GET requests more modular
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
from .handlers import uri_rewrites
2+
3+
__all__ = ['uri_rewrites']

nbviewer/providers/gist/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
from .handlers import default_handlers
22
from .handlers import uri_rewrites
3+
4+
__all__ = ['default_handlers', 'uri_rewrites']

nbviewer/providers/github/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
from .handlers import default_handlers
22
from .handlers import uri_rewrites
3+
4+
__all__ = ['default_handlers', 'uri_rewrites']

nbviewer/providers/github/client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# -----------------------------------------------------------------------------
77
import json
88
import os
9-
from urllib.parse import urlparse
109

1110
from tornado.httpclient import AsyncHTTPClient
1211
from tornado.httpclient import HTTPError

nbviewer/providers/github/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ async def deliver_notebook(
432432
nbjson = filedata.decode("utf-8")
433433
else:
434434
nbjson = filedata
435-
except Exception as e:
435+
except Exception:
436436
self.log.error("Failed to decode notebook: %s", raw_url, exc_info=True)
437437
raise web.HTTPError(400)
438438

nbviewer/providers/local/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
from .handlers import default_handlers
22
from .handlers import LocalFileHandler
3+
4+
__all__ = ['default_handlers', 'LocalFileHandler']

nbviewer/providers/url/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
from .handlers import default_handlers
22
from .handlers import uri_rewrites
3+
4+
__all__ = ['default_handlers', 'uri_rewrites']

nbviewer/providers/url/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ async def get_notebook_data(self, secure, netloc, url):
5656
rfp.set_url(robots_url)
5757
rfp.parse(robotstxt.splitlines())
5858
public = rfp.can_fetch("*", remote_url)
59-
except httpclient.HTTPError as e:
59+
except httpclient.HTTPError:
6060
self.log.debug(
6161
"Robots.txt not available for {}".format(remote_url), exc_info=True
6262
)

0 commit comments

Comments
 (0)