From 578ce63bd17df11d3ca7cd1083feebe4b92e457c Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 23 Jul 2020 15:31:03 -0700 Subject: simple lint (flake8) fixes over python codebase These should not have any behavior changes, though a number of exception catches are now more general, and there may be long-tail exceptions getting thrown in these statements. --- python/fatcat_web/__init__.py | 2 +- python/fatcat_web/routes.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'python/fatcat_web') diff --git a/python/fatcat_web/__init__.py b/python/fatcat_web/__init__.py index 56a2e020..562ffeb2 100644 --- a/python/fatcat_web/__init__.py +++ b/python/fatcat_web/__init__.py @@ -71,7 +71,7 @@ mwoauth = MWOAuth( mwoauth.handshaker.user_agent = "fatcat.wiki;python_web_interface" app.register_blueprint(mwoauth.bp, url_prefix='/auth/wikipedia') -from fatcat_web import routes, editing_routes, auth, cors, forms +from fatcat_web import routes, editing_routes, auth, cors, forms # noqa: E402 # TODO: blocking on ORCID support in loginpass if Config.ORCID_CLIENT_ID: diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py index 4684f799..2489ac03 100644 --- a/python/fatcat_web/routes.py +++ b/python/fatcat_web/routes.py @@ -935,7 +935,7 @@ def create_auth_token(): try: duration_seconds = int(duration_seconds) assert duration_seconds >= 1 - except: + except (ValueError, AssertionError): flash("duration_seconds must be a positive non-zero integer") abort(400) -- cgit v1.2.3