diff options
author | Christian Clauss <cclauss@me.com> | 2021-02-09 17:44:04 +0100 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2021-02-23 15:19:48 -0800 |
commit | 537659325664b47b01c24e82cb4a0e850cd129c0 (patch) | |
tree | bb7c93162d9f586a8bec17608cf7eceb11d47cf0 /fatcat_scholar/web.py | |
parent | 5878aa63118388361f353ca4f2f6c49a14a58b56 (diff) | |
download | fatcat-scholar-537659325664b47b01c24e82cb4a0e850cd129c0.tar.gz fatcat-scholar-537659325664b47b01c24e82cb4a0e850cd129c0.zip |
Modernize Python syntax with pyupgrade --py38-plus **/*.py
Diffstat (limited to 'fatcat_scholar/web.py')
-rw-r--r-- | fatcat_scholar/web.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fatcat_scholar/web.py b/fatcat_scholar/web.py index dce732b..43a733a 100644 --- a/fatcat_scholar/web.py +++ b/fatcat_scholar/web.py @@ -106,7 +106,7 @@ async def search(query: FulltextQuery = Depends(FulltextQuery)) -> FulltextHits: sentry_sdk.set_level("warning") sentry_sdk.capture_exception(e) raise HTTPException(status_code=400, detail=f"Query Error: {e}") - except IOError as e: + except OSError as e: sentry_sdk.capture_exception(e) raise HTTPException(status_code=500, detail=f"Backend Error: {e}") @@ -224,7 +224,7 @@ async def web_search( sentry_sdk.capture_exception(e) search_error = dict(type="query", message=str(e)) status_code = 400 - except IOError as e: + except OSError as e: sentry_sdk.capture_exception(e) search_error = dict(type="backend", message=str(e)) status_code = 500 @@ -282,8 +282,8 @@ async def favicon() -> Any: ) -ROBOTS_ALLOW = open("fatcat_scholar/static/robots.allow.txt", "r").read() -ROBOTS_DISALLOW = open("fatcat_scholar/static/robots.disallow.txt", "r").read() +ROBOTS_ALLOW = open("fatcat_scholar/static/robots.allow.txt").read() +ROBOTS_DISALLOW = open("fatcat_scholar/static/robots.disallow.txt").read() @app.get("/robots.txt", include_in_schema=False) |